Docker vs Kubernetes, what's better in a Homelab?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
to most of you it shouldn't be surprising I'm a big fan of containerization using Docker has been a game changer for me to run apps in my homeland it has made everything so much simpler and as my projects became bigger and more complex I wanted to go the next logical step and decided to create a high available kubernetes cluster with k3s and run some apps there as well but now since I'm running kubernetes along with Docker for about a year or so in my home lab I need to be honest there were moments where it just made me crazy and I already wanted to throw it out the window not just once I was dealing with all sorts of issues with the cluster replication storage networking it was a real headache I mean it's crazy how many things you need to master to just get started with kubernetes and that all raises up the question how useful is kubernetes really in a home lab is it all worth in the end or might it be better to just continue using Docker only and it looks like many of you are in the same boat as me I mean just check out some of the responses I got on YouTube and Twitter when I asked you about what are you using in your home lab Docker was always the clear favorite but I also have to say regardless of all the trouble that I had with kubernetes I still believe it has a place in a home lab there are some situations where it just makes so many things easier for me and if you are wondering what you should use in your home lab Docker kubernetes or maybe both let's try to find that out I will tell you based on my own experience what you need to keep in mind when you're planning to run kubernetes in your home lab let's explore some situations where it makes a lot of sense and also talk about some other situations where it might be better to just keep running darker this video is supported by teleport a free and open source access proxy that helps you to securely authenticate to all your it infrastructure like Linux servers databases kubernetes clusters web applications or remote desktop you can easily protect your accounts with modern security features such as two-factor authentication or a password that's logged in and access your services through the browser or the CLI tool with audit logging and session recording and the best it's completely free in the community version so you can just download and run it in your entire home lab or if you would like to use it in your company teleport offers many professional features like auditing single sign-on and more it's a great tool so just check it out you will find a link to their website in the description of this video so how I'm going to start this well the first I think I don't need to tell you what containerization is I I've made several videos about it and I guess most of you guys are already using Docker but just to summarize some of the pros and cons of it Docker is just great for running containers on a single host it's allowing you to run multiple isolated applications on a single machine it's very simple very straightforward and you get a lot of free and open source tools for it that help you manage your projects some of them I've already covered in previous tutorials see on this channel like Docker compost for example that's an amazing tool where you can easily spin up even complex environments with just a few commands or if you want to have a nice web-based management UI for Docker that I would always use portana that allows you to easily manage your Docker resources like containers images networks and volumes through a very simple and intuitive interface you can also use it to monitor the health of your servers and containers new locks and troubleshooting so Docker offers a great platform to run containers in your home lab and with other tools like Docker compose or potato you can enhance your workflow even more there's nothing wrong wrong with that but most of you will also probably agree as your workloads grow it can be a real pain to manage all your projects just with Docker especially if you're planning to scale your applications across different machines and because each Docker server is running separately with its own volumes its own networking stack at its own configs this can be especially problematic for smaller home Labs that are using Raspberry Pi's or Intel nooks and if you now like to add a second or a third server to your home lab you need to think about how you're managing your conflicts and resources for all the containers if you need a Central Storage location or how you're routing traffic to your servers and so on it's also not good with managing credentials because if you need to include passwords or other sensitive information into your containers then you're also having the problem of where you store them securely and how you're loading them into the containers environments and this is where you might start searching for a better tool than Docker that is a bit more versatile and offers you some kind of framework to solve these problems and I bet you have already heard that kubernetes is such a powerful platform for container orchestration and it's become the go-to choice for organizations looking to deploy containers at scale also in a home lab it can make a lot of sense because kubernetes has many features to manage deployment storage networking conflicts and secrets that is not only a much more powerful than Docker it also allows you to manage these resources easily across multiple servers and deploy containers in a high available scenario now I small containers I think it's just fine to keep running them with Docker I'm not saying that you need to change that but if your home lab gets bigger and your projects grow in size and complexity you will sooner or later run into these issues and start looking for a container orchestrator like kubernetes and actually getting started with kubernetes isn't so hard as most people believe it is I've already made a tutorial about how to set up a high available kubernetes cluster with just a few commands using k3s and there are also many other alternative Solutions around like canonicals micro Cades or mini cube with these tools you can get kubernetes up and running in just a couple of minutes that's how I've done it and I thought well that's awesome yeah I don't need to worry about running out of resources storing credentials somewhere on the local servers or migrate containers from one server to another I can just now deploy everything in my home lab on my new kubernetes cluster this is where my problems began because with great power comes great responsibility and kubernetes isn't a magic solution that solves all your problems with the snap of your fingers it introduces a new level of complexity and it will take time to learn how to set it up and manage it effectively over the time I had tons and tons of problems with it even though I would claim to have a pretty solid knowledge about Linux and containers but kubernetes takes all this to a new level it has a lot of moving parts and a very specific architecture that you need to familiarize yourself with what is a config map what is a storage class what is an Ingress controller what is the difference between a deployment and a stateful set all this matters in kubernetes and it requires a deep understanding of networking security and storage which can be difficult for even it professionals so that's why many people say that kubernetes is difficult to understand and I would totally agree it is and it it gets even worse when something inside the cluster itself is broken for instance I had this iteration once that one of the k3s servers went out of disk space and that somehow broke the entire FCD database so the core database where all the resources of kubernetes are stored in and even after increasing the disk space the LCD database didn't want to come up again and finally after troubleshooting for hours and hours I just decided to restore all the stuff from a snapshot I think that was the moment when I lost the last of my hair maybe for a kubernetes expert this would have been a very simple task but if you are a noob like me and you literally don't know what you're doing you have no idea where to start actually looking you can get in big trouble running kubernetes at home also another misconception about kubernetes is while it is true that kubernetes can provide a high level of for tolerance to your containers and parts it's important to note that this is only true for applications that are designed to run multiple instances for the applications that are designed to run in this way such as databases or Legacy apps kubernetes might not be the right solution and you will notice it when you try to run a MySQL container or an application like WordPress for example and you'll think it's a good idea to just raise the number of replicas to make it high available that's not how it works you still need to consider setting up a database replication and configure the correct storage back and forward press so while kubernetes does provide the features to help you solve these complex problems like high availability or replication it is still up to you to configure the apps and the infrastructure appropriately because at the end of the day some things in it are just complex there's nothing you can change about it and you of course always need to think about if that's really worth your time learning all this or if it might be better for you to just keep it simple that's by the way the reason why I'm still running my databases not inside a kubernetes cluster but on the second Docker server in my home lab and I also still have a few other applications on my first Docker server where I just want to have it simple and straightforward so my goal is not to replace Docker entirely with kubernetes my home problem I think there are still valuable reasons to use Docker in certain scenarios however there are also a few amazing things that you can only do with kubernetes which aren't easily possible in Docker yes there is a steep learning curve and the complexity can be a real challenge to overcome but once you learn the basics and you got familiar with some of the processes and how to work with kubernetes you will have access to a whole new set of tools and a new infrastructure that helps you solve these complex problems we've already talked about adding additional servers in your home lab High availability and credential management these are the known limitations of Docker and this is just so much better organized in kubernetes but there are also many other cool things that you can do with this platform and I quickly want to show you something for example I'm using a tool that is called Argo CD to deploy my applications in kubernetes this is a program for managing git Ops deployments and it provides a lot of automation and simplification making it much easier to manage resources in my cluster whenever I need to update my applications in kubernetes I can just make changes to the files in my git repository where I have defined all these resources then I commit these changes and push it to the repo and our OCD will automatically make these changes happening on the cluster and visualize all the different objects I don't need to restart anything I don't need to open any config files it just works fully automatic you also get other tools like Helm to deploy an even complex application stacked with versioning support in kubernetes or search manager that allows you to automate the management of SSL certificates traffic and modern hddp reverse proxy and load balancer that can automatically discover Services configure encryption and perform routing of incoming requests to your cluster and let's not forget about storage kubernetes also provides a variety of storage options from persistent volumes and claims to local distributed storage with Longhorn or open EBS it's very easy to manage storage across multiple servers to provide High availability this is just a fraction of what is all possible in kubernetes you get access to tons and tons of useful tools and options to address complex processes with containers sure it takes time to learn how this all works and how these tools interplay with each other but once you have come to a point where you understand most of it you can already create some pipelines and processes that simplify the day-to-day work in your home lab and you can build upon that knowledge and explore so many interesting and exciting tools and Technologies so in the end all the hassle all the trouble that I had with kubernetes even though I often had the moment where I wanted to screw it all I would say it was absolutely worth my time because let's not underestimate how much valuable these skills are that you are learning by setting up and managing a kubernetes cluster on your own you can develop a deep understanding of how the platform works and how to troubleshoot all the issues that may arise and this is what professional companies are looking for yeah kubernetes is becoming increasingly popular and probably the go-to standard in tech industry when it comes to container orchestration and if you can gain hands-on experience with it in your home lab you're developing some really useful skills so what can we learn from all this well I already said it before I think in a simple home lab with just one single server kubernetes would be an absolute Overkill and if you have no intentions to learn this technology you are happy with Docker I think there is a very minimal benefit you would get from using kubernetes but if you are willing to invest some time into learning new tech skills and you have a bigger home lab with many projects and containers I think kubernetes will make so many things easier for you in the long run and it's absolutely worth your time as an I.T guy yes it can be challenging to get started I totally get it but you will also gain a valuable skill set that's in high demand in the IT industry that's perhaps the best argument to get started with it of course you can follow my channel and watch more exciting videos about kubernetes and Docker I'm continuing to make more content for you in the future and I hope this video helped you to understand the different challenges with container Technologies a bit better and I could answer your question what might be better for you to use in a home lab Docker or kubernetes or maybe both just like I do it as always thanks everybody for watching I will catch you in the next video take care bye bye
Info
Channel: Christian Lempa
Views: 71,200
Rating: undefined out of 5
Keywords:
Id: n-fAf2mte6M
Channel Id: undefined
Length: 14min 56sec (896 seconds)
Published: Tue Mar 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.