Kubernetes in a nutshell
If you read blogs about DevOps or visit DevOps related conferences, chances are high that you heard something about Kubernetes. Last week at the DevOn Summit 2018, around a third of the talks mentioned Kubernetes. Jayne Groll – CEO of the DevOps institute – stressed in her talk “Modern skills for DevOps professionals” that it is important to know technologies like Kubernetes. This blog explains the what and why about Kubernetes to get you up to speed in just a couple of minutes.
What is Kubernetes?
Kubernetes is an open-source container orchestration platform. It was designed and created by Google and is now maintained by the Cloud Native Computing Foundation. Container orchestration means that Kubernetes takes care of the deployment, scaling and management of containerized applications.
What is the relationship with Docker?
In the last couple of years, Docker became the standard for containerizing applications. With Docker, you can make your applications portable and run them in any environment without the traditional hassle of installing all kinds of frameworks and other necessary dependencies on your infrastructure. Instead, you pack your applications in containers that also include all dependencies needed. This way, you can run them everywhere (as long as Docker is installed) and spin up an application very fast.
Docker fits perfectly in a DevOps way of working by making faster feedback possible and implementing practices like automation and IaC. For example, a developer can run an entire chain of applications on his/her local machine in a matter of seconds instead of relying on a shared test environment.
To create some confusion: Docker is a tool, but Docker is also the name of the company who created the tool. The company Docker also provides other products, of which Docker Swarm is one (see competitors).
Which problem does Kubernetes solve?
While Docker is perfect for packing and running your application as a container, we still miss some features when we want to use this in a production environment. For example, if you run a container and for some reason the application in it crashes, the container stops working as well and you need to restart it. If you want to deploy a new version, you need to stop the container that currently runs, and start a new container with a new version. And if you want zero-downtime deployments, you have to create script yourself to handle that. In conclusion, while Docker provide some advantages, you still need to do your system administration tasks.
This is where Kubernetes comes into play. Kubernetes allows you to define how your containerized application should operate, and Kubernetes takes care of the rest. That means it takes care of:
- Starting and stopping containers as needed
- Exposing the functionality of containers to end-users or other containers (service discovery)
- Monitoring the behavior of containers and acting on it
- Deploying new versions of a container with zero-downtime
- Scaling, both automatic and manually
Kubernetes uses a declarative way of working. This means that you don’t give it commands like: “start a container on this machine”, but you describe the desired situation: “I want 2 instances of my container running”. So, when a container crashes or stops working, it automatically redirects requests to other containers while restarting the faulty one.
Kubernetes is cloud native, that means that it will use the functionality and services that cloud platforms provide besides just plain Virtual Machines. Examples are using functionality like load balancers, networks and public IP addresses. While being cloud native, you can also run Kubernetes on your on-premise data center and orchestrate your containers locally.
What will change when I implement this in my company?
Kubernetes fits perfectly in a DevOps workflow that avoids manual repetitive labor, provides fast feedback and allows developers to deploy fast, early and often. Given the popularity of Microservices, Kubernetes is a good fit for this type of architecture as well.
Just because Kubernetes takes care of a lot of operational tasks, it doesn’t mean that there’s no need for system administrators anymore. However, the kind of activities will change. Instead of being busy performing all kinds of operational tasks, administrators now have time to focus on innovation and improvement.
What are competitors of Kubernetes?
Docker Swarm is the answer of Docker to the container orchestration problem. Docker Swarm has a lot of functionality that is similar to that of Kubernetes. It is a bit more limited in functionality, for example it doesn’t support auto scaling. On the other hand, it’s easier to set up in your own data center, as Kubernetes requires more planning.
DC/OS (Datacenter Operating System) is another alternative to Kubernetes, based on the Apache Mesos distributed system kernel. This platform also has the same functionality as Kubernetes.
AWS with Elastic Container Service also provided functionality to run and manage your containers. Since the end of 2017, they launched Elastic Container Service for Kubernetes. It seems like they no longer want to compete with Kubernetes with their own service.
It looks like Kubernetes has won the battle of container orchestration. All major cloud platforms provide native Kubernetes support, it is considered production-grade and has a lot of support.
Where can I find more information on Kubernetes?
You can find a lot of information on the official website of Kubernetes: kubernetes.io. Like mentioned in the start of this blog, chances are high that DevOps conferences also have talks that include Kubernetes. If you are a developer and don’t want to run a cluster in the cloud, you can also install Minikube to experiment with Kubernetes locally. Have fun!
This blog was written by Harm Pauw.