Kubernetes
Kubernetes for K8S for short is a container orchestration tool which was developed by Google and made open-source in 2014. It helps you manage containerized applications in different deployment environments like physical machine or VM.
Why container orchestration?
Traditionally the applications used to be monolith, i.e. self-contained and independent from other applications. Monolith architecture had some drawbacks like scalability, lack of flexibility and barrier to adoption for new technologies. These issues get addressed in micro-service architecture. A monolith application is broken down to multiple micro-services which can talk to each-other. Micro services get packaged as container which is nothing but a standard unit of software that packages up code and all its dependencies so the application runs quickly. Now there a demand for a proper way of managing those hundreds of containers.
Features
- High availability or no downtime: K8s provides load balancing and automated failover. It can automatically restart failed containers, replace unhealthy instances and distribute traffic across healthy instances.
- Scalability or high performance: It can easily scale up or down by adding or removing instances (pods) based on the demand.
- Disaster recovery: A Kubernetes cluster is a group of master and worker nodes. If a node goes down available nodes will distribute the traffic between them.
K8S Architecture
A Kubernetes cluster is a set of Master and Worker machines. The worker machines (known as Nodes) does that actual work and runs the containerized applications. The master manages the cluster and provides API that is used to configure and manage resources in the cluster. Both master and worker nodes run multiple process, we’re going to discuss the important once.

Worker Processes
- Container Runtime: It is the one which runs the container. It is responsible for managing the execution and lifecycle of containers. K8S supports multiple container runtimes like docker, containerd etc.
- Kubelet: Kubelet starts the Pod with container inside the node. It interacts with the container and node and assigns resources from node to the container.
- Kube Proxy: Forwards the request form the Service to the Pods. Have intelligent forwarding logic in side that make sure forwarding works in performant way. Eg. If application is making request to the database, it forwards the request to the database container running in the same node instead of randomly sending to any database container in the cluster.
Master Processes
- Kube API server: API server act as a cluster gateway. A K8S client will interact with API server to update or query the cluster. It also acts as a gatekeeper for the authentication, which makes sure you have enough permission to perform particular action (creating or destroying the resource).
- Kube Scheduler: When an application comes for the deployment scheduler checks how much resources the application will need and make decision where to put the new pod by looking for the node with available resources. One thing to note is scheduler doesn’t actually create the pod, it just decide where to create and asks Kubelet to create the pod.
- Kube Control Manager: Control manager detects and manage the cluster state. For example if a pod dies, control manager detects that and try to recover the cluster to its original state. Kube Control manager notifies Kube Scheduler that a new pod need to be created. Kube Scheduler interacts with Kubelet and creates the pod.
- etcd: It is a key value storage for the cluster. All the cluster changes get stored into etcd. It acts as the brain of the cluster as it has all the information about it. One thing to note is etcd doesn’t store any application data.
K8S Components: