Use Docker Instead of Kubernetes
Use Docker Instead of Kubernetes
Take a look at why this developer argues that you should focus more on Docker as opposed to Kubernetes in your container management.
Join the DZone community and get the full member experience.Join For Free
Learn how to migrate and modernize stateless applications and run them in a Kubernetes cluster.
Today we are all talking about containers and container-based infrastructure. But what is this container technology? And how does it solve today problems?
I am using containers myself and of course, I am fascinated by this server technology. Containers can really simplify things. After more than 20 years in building server applications, I have experienced many problems very closely.
I call it "server technology," which may sound a little strange to some. Are containers not more of a cloud technology? This is the one thing that really bothers me is this current hype. When I talk about containers many people think about this Kubernetes thing. And this was the inspiration to write this article.
What is Docker?
Why do we need a container technology? The most important reason in my view is the fact that it’s just very hard to manage servers. And here I speak exclusively of Linux servers. Not because Linux is particularly complicated, but because Linux is today the only relevant server system of the Internet. You need to worry about how to run a server on the Internet and how to protect it from attack. Once you’ve done that, it’s a waste to use this server for just one thing. Or to make a current trend, to use it only for one microservice.
But in 2006, Linux has developed a very interesting technology called "cgroups." cgroups (abbreviated from control groups) is a Linux kernel feature that limits, accounts for, and isolates the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes. This is the core technology of containers running on a Linux server. Again, it’s not easy to use this cgroups if you are not very familiar with Linux kernel technologies. So this was one reason why cgroups are not well known.
And this is what Docker brings into the game. The Docker project simply gives you a handy toolset to manage cgroups on a Linux server. It is so easy to use that most people do not know they are working with a Linux kernel technology. Docker just helps us to run many services secured and isolated on one server. One core tool of Docker is the "Docker Swarm." Docker Swarm allows you to connect different servers to a kind of cluster. This becomes important when you have more than one server to manage.
So when we talk about containers and especially about Docker, we basically always talk about a Linux kernel technology.
What is Kubernetes?
So now, what is Kubernetes and why do we need it? To understand this, you have to imagine the following scenario: you don’t have one or a dozen Linux servers to run, but thousands. And you do not run one microservice, but tens of thousands. I hope you’re currently not in such a situation. But companies like Google and Amazon are exactly in this situation. Therefore, these companies are working on technologies to operate such large environments. Basically, this operating platform is also just about managing services which are based on Linux cgroups.
Google has published such a technology under the name Kubernetes. But this technology was not invented for the operation of a single web project in a small company, although this is of course possible. We also do not use a rocket to go on holiday.
Please don’t get me wrong – Kubernetes is a great technology and it’s great that this technology is freely accessible. But do you need this? For any reason, today everyone seems to believe that they need to use this technology for their own projects. Presumably to be as successful as Google and Amazon.
Why You Should Use Docker
So finally – why you should use Docker instead of Kubernetes. As I explained before, when we talk about container technology, we talk about Linux kernel technology. You should gain a little experience with Linux if you want to use containers in your projects. Docker offers an ideal toolset to deal with the technology behind it (cgroups). This is the one reason I recommend Docker. The other reason is that you remain independent of a particular technology platform. Even if Kubernetes has a large and growing community, it is not the same as with Linux. Kubernetes has a very strong connection to today’s Internet giants like Google, Amazon, and Microsoft. With Kubernetes it is almost too easy to store your data into one of these platforms. Even if it seems tempting for most projects, Docker and Docker Swarm is often sufficient. It is clear simple and transparent. I think it is much better to run your own server with a technology that you can control and is not just convenient.
Also, it's easy to build a lightweight Docker Swarm environment with a lot of cool features and lots of functionality from existing management containers. Take a look at the open project "Imixs-Cloud" on Github.
Published at DZone with permission of Ralph Soika . See the original article here.
Opinions expressed by DZone contributors are their own.