What is Kubernetes?
Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.
The name Kubernetes originates from Greek, meaning helmsman or pilot. K8s as an abbreviation results from counting the eight letters between the “K” and the “s”.
Google open-sourced the Kubernetes project in 2014. Kubernetes combines over 15 years of Google’s experience running production workloads at scale with best-of-breed ideas and practices from the community.
Kubernetes.io
What Problem Does Kubernetes Solve?
As with any technology, when we learn it for the first time, one of the first questions we should ask is “what problem does it solve?”.
Early Days
To answer this question, let’s go back to early days when dinosaurs ruled the Earth (kidding, you know what I mean!).
In early days, people used to deploy their applications on physical servers. This worked out fine as long as the software application was small and simple but as the complexity grew, it led to problems.
For instance, there was no way to define resource limits on a physical server. So if more than one application ran on the same server, one application could consume all the resources, leaving the others to starve and under-perform.
Of course you could have dedicated servers for each application but that was really expensive and it did not scale well as some applications could under-utilize server resources as well.
Age of Virtual Machines
So as a solution to these problems in early days, virtualization technologies came into picture. With virtualization, we could have multiple virtual machines running on a single physical server. Each machine was a full machine with it’s own Operating System. These machines would share the resources of the physical server.
Since each application ran on it’s own virtual machine, it provided better isolation between different applications.
Furthermore, we no longer needed to have a physical server for each of our applications, which improved the scalability of applications and reduced the cost as well compared to early days.
However, this setup isn’t without drawbacks either, despite being an improvement over the past solutions. A major one being VMs still could take up a lot of CPU, RAM and storage resources as each VM runs on it’s own Operating System. This wouldn’t be much of a problem for large applications but with the emergence of architectures such a micro-services and cloud technologies, usage of VMs isn’t as practical as it used to be.
Rise of Containers
Containers are very similar to VMs but they are much more light weight. Instead of basically creating a whole virtual computer for the application, a containerization technology combines the application code, all the binaries, libraries and even the Operating System to a single package.
This allows us to run the application almost anywhere as long as the container runtime is installed. Like a VM, a container also gets it’s own CPU, storage and memory resources, but it is not coupled with the underlying host Operating System.
Unlike a VM though, a container is not a machine itself, but a process that takes advantage of an Operating System’s ability to assign resources to a process.
Okay, but that still doesn’t explain what we need Kubernetes for!
As mentioned above, containers are a good way to run applications. But you still need a way to manage them. For instance, think about a deployment of an enterprise application that takes advantage of a micro-services architecture. There could be perhaps dozens, or even more micro-services each deployed as containers. How can you keep track of the health and status of all these containers? How do you ensure zero down time? How do you rollout updates or roll them back with minimal interference? How do you define resource limits each container can use? All this becomes a problem when you have to maintain a large number of containerized deployments.
That’s where Kubernetes comes in. Kubernetes is basically a framework that provides you a way to manage containerized deployments. Following are some of what Kubernetes do.
- Providing a way to create a clustered app deployment environment and orchestrate containers across the cluster.
- Providing a way to utilize hardware resources across the deployments in an optimal way.
- Orchestrate storage by mounting storage systems of choice.
- Ability to scale applications with minimal interference on the fly.
- Define strategies to rollout and rollback updates for apps.
- Track the health of containers and restart or replace failing ones without any manual intervention.
- Allows secure storage of sensitive information such as passwords, web tokens, SSH keys etc.
What Kubernetes is Not
- Kubernetes is not a mere orchestration system. In fact, it eliminates the need for orchestration. The technical definition of orchestration is execution of a defined workflow: first do A, then B, then C. In contrast, Kubernetes comprises a set of independent, composable control processes that continuously drive the current state towards the provided desired state. It shouldn’t matter how you get from A to C. Centralized control is also not required. This results in a system that is easier to use and more powerful, robust, resilient, and extensible. – Kubernetes.io
- Kubernetes is not a traditional Paas(Platform as a Service) system, despite having some of PaaS features.
- Kubernetes does not have any limitations with regards to which applications it can run. Any application that can be containerized can be deployed with Kubernetes.
- Kubernetes does not provide any application level services such as Middleware or caching mechanisms. However you can run such services on Kubernetes.