Container Orchestration and Kubernetes — Part 2

Hello everyone. In this article, we are going to see what is Container Orchestration and the famous orchestrators in the market. Then we are going to deep dive into the Kubernetes architecture and find out how it is different from Docker

What is Container Orchestration?

Container Orchestration is the process of managing all the Docker containers. Without Orchestration, it is extremely difficult to handle them as a lot of containers get spun up in seconds when the application load goes up. Big companies run tons of containers and hence it is extremely important to use the Container Orchestration

The Container Orchestrator manages the important operations namely

  • Configuration for the containers
  • Provisioning the containers and deploying them
  • Allocating the resources for the containers
  • Monitor the health of the containers
  • Routing the network traffic to the containers and load balancing the requests
  • Service discovery for the containers
  • Maintaining the high availability of the containers
  • Scale the containers according to the configuration when the request spikes up
  • Manage the entire life cycle of the containers

List of Container Orchestration Tools

In the software industry, developers are spoilt for choices when picking up the technology and tools to use and Container Orchestrators are no different. There are a lot of such tools available and the famous ones are

  1. Kubernetes
  2. Apache Mesos
  3. Red Hat Openshift
  4. AWS ECS (Elastic Container Service) and Fargate
  5. AWS EKS (Elastic Kubernetes Service)
  6. Google Container Engine (GKE)
  7. Hashicorp Nomad
  8. Rancher
  9. Docker Swarm
  10. Azure Kubernetes Service (AKS)

All the above orchestrators are further classified into two types namely

1. Self-hosted tools

In self-hosted, administrators set up the full cluster and manage it. It is a bit complicated to do but many organizations prefer this option as it is flexible and they have full control over the cluster

2. Fully-managed tools.

All the cloud providers provide fully managed orchestration tools. Examples are AWS Fargate, AWS ECS, AWS EKS, GCE, AKS, etc. Here, we don’t get access to the master node but it reduces a lot of overhead

It is again based on choices to go for one of the orchestrator types and then select the best orchestrator tool based on the needs

Benefits of Container Orchestrators

  • Security and compliance
  • Easy to develop and maintain
  • Easy of deployment and maintenance
  • Reduces a lot of overhead for the team
  • Support for monitoring, logging, and tracing

Kubernetes — The helmsman

The tool Kubernetes originated from the ancient Greek term “Kubernetes” which means a helmsman, someone who steers a container ship. It is also spelled as k8s, a shorthand notation to compress the 8 letters between k and s.

Google has introduced Kubernetes in 2014 and it has donated it to the CNCF (Cloud Native Community Foundation), which maintains Kubernetes now.

The Kubernetes architecture can be divided into 2 major components namely

  1. The Control plane
  2. Worker nodes

1. Components of the Control Plane

The control plane is also called Master Node and it runs the critical components that are responsible for running the cluster and storing the configurations for the cluster.

1. API Server

The Kube-API server exposes the APIs of Kubernetes to the outside world and it serves as the front end of the control plane. The API Server can be scaled horizontally and any request from the client to access the nodes will be routed through this component

2. Scheduler

kube-scheduler is responsible for scheduling the newly created pods in the appropriate node and also does the health check of the cluster. It is also responsible to store the resource usage data of each node in the cluster

3. Controller Manager

The Controller Manager is the one that manages all the controllers for the cluster like checking if a node is deleted, setting up routes to the new nodes, provisioning networking for the nodes, scheduling jobs, life cycle operations

4. etcd

It is a highly available and consistent key-value database store for the entire Kubernetes cluster. It acts as a single source of truth for all the components inside the cluster

2. Components of a Worker Node

The node is nothing but the machine that runs the Docker containers. The cluster nodes are spun by the Control Plane and each node has the following components

  1. Container Runtime Engine

This component is nothing but software that runs and manages the life cycle of containers. Docker is the famous Open Container initiative runtime. But there are other container technologies like CRI-O and rkt that are supported by the runtime Engine.

2. Kubelet Service

The kubelet is an agent that runs on each node in the cluster and is responsible for running the containers in the pod

3. Kube-proxy service

The kube-proxy is a network proxy service that helps with the networking of data in the cluster. It provides networking routing, load balancing, etc on the node

4. Pods

The smallest unit inside the Kubernetes is a pod. It is nothing but an instance of the container and each pod contains one or more containers and they are highly scalable horizontally

Docker vs Kubernetes ?

We have seen Docker in the previous article and Kubernetes in this article. There is always a common question what is the difference between Docker and Kubernetes? Let me answer here

Docker is the technology to build containers by packaging all the dependencies required to deploy and run the application whereas Kubernetes is an Orchestrator tool to run such containers and manage their life cycle. Both Docker and Kubernetes work hand in hand to achieve the objective for any containerized applications

What is Docker Swarm?

Docker Swarm is one of the production-grade Container Orchestrator tools for managing Docker containers and it is very easy to deploy and manage when compared to the Kubernetes. It is very good for small organizations to get started with the containers and deploy them in production but it does not provide some advanced functionalities provided by Kubernetes and that’s the reason over 80% of organizations use Kubernetes.

Thanks for reading and stay tuned !!!!

I work as a freelance Architect at Ontoborn, who are experts in putting together a team needed for building your product. This article was originally published on my personal blog.