New to DevOps (Week #3)

New to DevOps (Week #3)

Kubernetes

Kubernetes, also known as K8s, is an open-source system for automating the deployment, scaling, and management of containerized applications. In 2014, Google introduced Kubernetes as an open-source written in GoLang and later donated it to CNCF (Cloud Native Computing Foundation).

Features of K8s

  • Orchestration (managing all the containers inside the cluster)

  • Autoscaling

  • Auto Healing

  • Load-balancing

  • Platform Independent

  • Health monitoring of containers

  • Fault Tolerance (failure of the node/pod)

  • Rollback (going back to previous versions)

  • Batch Execution

Architecture of K8s

The architecture of a K8s cluster consists of 2 parts namely the Control Plane and the Node. Now, the number of nodes can vary according to the user's requirements. The control plane works with 4 components and they are :

  1. API Server: This is the entry point of the K8s cluster. It directly interacts with the user with the help of kubectl command. It also is responsible for scaling the server as per the load/traffic. In other words, the API server is the front end of the control plane.

  2. etcd: It is the Kubernetes backing store. Stores metadata and status of the cluster.

  3. Scheduler: This component ensure pod replacement in the node. It assigns the node(s) to create and run the pods.

  4. Controller Manager: It keeps track of what's happening in the cluster.

Kubelet, Container Engine and Kube-proxy

Kubelet is the agent that runs on the node, carries out the job offered by the control plane and reports their status.

Container Engine works with the kubelet, pulls the images of the apps, starts and stops the containers and exposes the ports that are specified to run the application.

Kube-proxy assigns IP to each pod, it operates on the node and makes sure that each pod gets a unique port number.

These 3 components make up each node inside the K8s cluster.

POD

The smallest unit in Kubernetes is the POD. It is a group of one or more containers that runs on the same host. Inside each pod, a container is created to run which is controlled by the control plane. It is advised to run one container on one pod, although multi-container pods are also created that share volume and space. The concept of PODs is used to support multiple processes that runs cohesively.