Kubernetes and it's Architecture:

Kubernetes and it's Architecture:

  1. What is Kubernetes?

    Kubernetes is a open source Container Orchestration platform that helps manage and orchestrate containers, which are like lightweight virtual machines for running applications

  2. What are the advantages of Kubernetes over Docker?

  • By default Kubernetes is a cluster (a group of nodes). In prod it is installed in Master node. Kubernetes has a multi-node architecture where it can put apps or pods in different nodes.

  • Auto Scaling - Kubernetes has Replication Controller/Replica set, it can automatically adjust the number of running instances of a workload based on observed metrics such as CPU utilization or custom metrics. It also supports Horizontal Pod Autoscaler (HPA) - automatically scales the number of replicas of a Deployment, ReplicaSet, or StatefulSet based on observed CPU utilization or custom metrics.

    Vertical Pod Autoscaler (VPA) - Vertical Pod Autoscaler automatically adjusts the resource requests and limits of individual Pods based on observed resource utilization.

  • Auto Healing - Kubernetes controls & fix the damage.

    -> container is going down, it has a feature of auto-healing so even the container goes down, kubernetes will start a new container

    -> kubernetes has something known as API server and whenever the API server knows the container is going down, immediately it will roll out a new container,

  • Enterprise level support - Kubernetes was originated from Google and it is a Enterprise level Container Orchestration platform

  1. Architecture of Kubernetes:

Kubernetes have === Control Plane (MASTER) & Data Plane (WORKER)

  1. Why you need control Plane?

    For any enterprise level tools or enterprise level components there are some specific standards. Kubernetes is a Cluster.

    • API Server - The key component of the Control Plane is the Kube API Server. It is the heart of Kubernetes. It exposes an HTTP API that lets end users, various parts of our cluster, and external components communicate with each other.

      The interaction with the API Server can be done in three ways:

      1. UI

      2. API

      3. CLI Kubectl

    • Schedular - Scheduler watches for newly created Pods that have no assigned nodes. It selects a worker node for them to run on. [Kube-Schedular]

    • etcd - Is a Key Value store and the entire Kubernetes Cluster information is stored as Objects or key value pairs inside this

    • Controller Manager - Controllers or the Replica Set are used for maintaining the state of kubernetes PODS. If one pod is not enough, you can autoscale it to 2 or 3 Pods.

    • Cloud Controller Manager - The cloud controller manager lets us link our cluster to a specific cloud provider’s API, and separates out the components that interact with that cloud platform from components that only interact with our cluster.

      It can run on any Cloud Platform such as EKS, AKS, etc.

  2. Worker node and its components:

  • Kube-proxy - Responsible for Networking, like generating the IP address or Load Balancing, it uses IP table on your Linux machine.

  • Kubelet - It is basically responsible for the creation of PODS and it will ensure that the POD is in running state and if not then it will take necessary action using the kubernete's Control Plane

  • Container-Runtime - Container runtime, also called container engine, is a software component. Its job is to run the containers. In detail, container runtime is responsible for verifying and loading container images, monitoring system resources, isolating and allocating resources, and also does the management of container lifecycle.

    A few examples of container runtimes are, containerd, CRI-O, Docker Engine, and Mirantis Container Runtime*.*