Migrating from Docker Compose to Kubernetes: My Journey
I’ve been running a Docker stack on my Dell PowerEdge T440 server for years, and it’s been a great experience. With around 100 containers spread across 50 stacks, I’ve got a lot of services up and running, from media containers to home automation tools. But lately, I’ve been thinking about making the switch to Kubernetes. In this post, I’ll share my journey, the challenges I’ve faced, and what I’ve learned so far.
Why Kubernetes?
So, why am I considering migrating to Kubernetes? For one, I’m hoping to reduce my power consumption. My server has two 1100W power supplies, which idle at around 200W each. It’s not a huge amount of power, but every little bit counts, right? I’m also drawn to the idea of having a more scalable and flexible system. With Docker Compose, I’ve had to manually configure each container and stack, which can be time-consuming and prone to errors. Kubernetes promises to simplify this process and make it easier to manage my containers.
My Current Setup
Before I dive into Kubernetes, let me give you a brief overview of my current setup. I’ve got a Dell PowerEdge T440 server with 128GB of RAM and around 30TB of usable disk space. I’m running Ubuntu 24.04, and I’ve got a mix of containers, including media containers, Emby, AdGuard, FreshRSS, Home Assistant, and more. I’ve also got a Nvidia Tesla P40 for playing around with machine learning and other projects.
Kubernetes: The Good, the Bad, and the Confusing
I started by setting up a Kubernetes cluster using K3S, which is a lightweight, certified Kubernetes distribution. I chose K3S because it’s easy to set up and use, and it comes with Traefik built-in, which is a popular ingress controller. I’ve also got cert-manager set up, which generates SSL certificates for my containers. But, despite the ease of setup, I’ve found Kubernetes to be confusing and overwhelming at times. There are so many new concepts to learn, from pods and deployments to ConfigMaps and ClusterIssuers. It’s like learning a new language, and it takes time and practice to get the hang of it.
Challenges and Frustrations
One of the biggest challenges I’ve faced is getting my containers to use the SSL certificates generated by cert-manager. I’ve spent hours tweaking configurations and troubleshooting issues, but I still haven’t got it working perfectly. I’ve also had trouble getting the Kubernetes dashboard up and running, which is frustrating because it would make it so much easier to manage my containers. Despite these challenges, I’m determined to persevere and learn as much as I can about Kubernetes.
Options and Alternatives
As I navigate the world of Kubernetes, I’ve started to consider alternative options. One possibility is to stick with Docker Compose on a single host. This would mean giving up on the idea of a scalable, flexible system, but it would also simplify things and reduce the learning curve. Another option is to use Docker Swarm, which is a container orchestration tool that’s similar to Kubernetes but easier to use. However, Docker Swarm doesn’t seem to be as popular as Kubernetes, and I’m not sure if it would meet my needs in the long term.
The Verdict
So, what’s the verdict? Should you migrate from Docker Compose to Kubernetes? It’s not an easy decision, and it depends on your specific needs and goals. If you’re looking for a scalable, flexible system that can handle a large number of containers, Kubernetes might be the way to go. But, if you’re short on time or not interested in learning a new system, Docker Compose or Docker Swarm might be a better choice. For me, the journey is just beginning, and I’m excited to see where Kubernetes takes me.
Polska wersja
Przez lata korzystałem z Docker Compose na moim serwerze Dell PowerEdge T440 i było to wspaniałe doświadczenie. Z około 100 kontenerami rozproszonymi po 50 stackach, mam wiele usług w działaniu, od kontenerów multimedialnych po narzędzia do automatyzacji domu. Jednak ostatnio rozważam przejście na Kubernetes. W tym poście podzielę się swoją podróżą, wyzwaniami, których się spotkałem i tym, czego nauczyłem się do tej pory.
Dlaczego Kubernetes?
Czemu rozważam migrację na Kubernetes? Po pierwsze, mam nadzieję zmniejszyć zużycie energii. Mój serwer ma dwa zasilacze 1100W, które w trybie czuwania zużywają około 200W każde. To nie jest dużo energii, ale każdy mały krok się liczy, prawda? Jestem również przyciągnięty pomysłem posiadania bardziej skalowalnego i elastycznego systemu. Z Docker Compose musiałem ręcznie konfigurować każdy kontener i stack, co może być czasochłonne i podatne na błędy. Kubernetes obiecuje uprościć ten proces i ułatwić zarządzanie kontenerami.
Moja obecna konfiguracja
Przed tym, jak zanurzę się w Kubernetes, pozwólcie, że podsumuję moją obecna konfigurację. Mam serwer Dell PowerEdge T440 z 128GB pamięci RAM i około 30TB miejsca na dysku. Uruchamiam Ubuntu 24.04, i mam mix kontenerów, w tym kontenery multimedialne, Emby, AdGuard, FreshRSS, Home Assistant i wiele innych. Mam również kartę Nvidia Tesla P40 do eksperymentowania z uczeniem maszynowym i innymi projektami.
Kubernetes: dobre, złe i mylące
Zacząłem od utworzenia klastra Kubernetes przy użyciu K3S, który jest lekką, certyfikowaną dystrybucją Kubernetes. Wybrałem K3S, ponieważ jest łatwy w użyciu i konfiguracji, oraz posiada wbudowany Traefik, który jest popularnym kontrolerem przychodzącego ruchu. Mam również ustawiony menedżer certyfikatów, który generuje certyfikaty SSL dla moich kontenerów. Jednak pomimo łatwości konfiguracji, znalazłem Kubernetes mylącym i przytłaczającym w pewnych momentach. Jest tak wiele nowych pojęć do nauki, od podów i wdrożeń po ConfigMapy i ClusterIssuers. To jak uczenie się nowego języka, i wymaga czasu i praktyki, aby oswoić się z tym.
Wyzwania i frustracje
Jednym z największych wyzwań, których się spotkałem, jest uzyskanie możliwości korzystania z certyfikatów SSL wygenerowanych przez menedżer certyfikatów. Spędziłem godziny na dostosowywaniu konfiguracji i rozwiązywaniu problemów, ale nadal nie mam wszystkiego działającego idealnie. Miałem również trudności z uruchomieniem pulpitu nawigacyjnego Kubernetes, co jest frustrujące, ponieważ ułatwiłoby to zarządzanie kontenerami. Pomimo tych wyzwań, jestem zdeterminowany, aby nauczyć się jak najwięcej o Kubernetes.
Opcje i alternatywy
Podczas nawigacji w świecie Kubernetes, zacząłem rozważać alternatywne opcje. Jedną z możliwości jest pozostanie przy Docker Compose na jednym hoście. Oznaczałoby to rezygnację z pomysłu posiadania skalowalnego, elastycznego systemu, ale uproszczyłoby to sprawy i zmniejszyłoby krzywą uczenia. Inną opcją jest użycie Docker Swarm, który jest narzędziem do orchestrowania kontenerów, podobnym do Kubernetes, ale łatwiejszym w użyciu. Jednak Docker Swarm nie wydaje się być tak popularny, jak Kubernetes, i nie jestem pewien, czy spełniłby moje potrzeby w dłuższej perspektywie.
Werdykt
Czy więc powinieneś migrować z Docker Compose na Kubernetes? To nie jest łatwa decyzja, i zależy od Twoich konkretnych potrzeb i celów. Jeśli szukasz skalowalnego, elastycznego systemu, który może obsłużyć dużą liczbę kontenerów, Kubernetes może być odpowiednim wyborem. Ale jeśli masz ograniczony czas lub nie chcesz uczyć się nowego systemu, Docker Compose lub Docker Swarm może być lepszym wyborem. Dla mnie podróż dopiero się zaczyna, i jestem podekscytowany, aby zobaczyć, dokąd mnie Kubernetes zaprowadzi.