We are living in the age of containers. More and more companies are in the middle of redesigning and rewriting their monolith applications in the microservices way, deploying it in containers. Of course, all the deployed containers need to be orchestrated by something. And there we go… there are some pieces or software able to do container orchestration into the cloud or in a bare-metal environment like Apache Mesos, Amazon Elastic Container Service (Amazon ECS), Kubernetes, Helios or even Docker Swarm.
As the title says, in this series our attention will point to Kubernetes. Kubernetes (or K8S) is an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery.
Kubernetes was initially designed by Google and now is maintained by Cloud Native Computing Foundation (CNCF). It is open source giving you the freedom to take advantage of on-premises, hybrid, or public cloud infrastructure, letting you effortlessly move workloads to where it matters to you.
Why so popular?
The main concern of the organizations that are migrating their infrastructure to microservices and containers is to find a strong and stable platform. There are some reasons why Kubernetes is chosen:
- Speed up the whole process: Kubernestes does a great job in offering a layer of abstraction for the hardware in terms of a Platform as a Service. In a few words, is more easily for development teams to request resources at the moment they need. The whole process becomes self-service! No more forms to be completed in order to request a new machine or more resources for an existing one!
- Cost efficiency: By offering a layer of abstraction over the hardware, splitting the resources becomes much more efficient in this context.
- Portability: Kubernetes can run almost anywhere… you can deploy it on virtual machines, physical ones or even on a bunch of Raspberry Pi’s. Being platform agnostic, and taking advantage of the container paradigm, any app that runs in Kubernetes is not affected if the cloud provider is changed or it needs to run in an on-premise env.
K8S architectural overview
Kubernetes is built on the master-slave paradigm. The main component in this context is a cluster. Cluster is composed from a bunch of machines, called nodes. Each node hosts groups of one or more containers (which contain your applications), and the master communicates with nodes about when to create or destroy containers. At the same time, it tells nodes how to re-route traffic based on new container alignments.
This article is meant to be a pilot for a series of articles about K8S. My goal with this series is to highlight real-world examples and problems I had to deal with. I am the kind of person that learn fast if I can see the practical applicability of the example, so I think this series will help beginners to understand how Kubernetes works.