Kubernetes Architecture

Kubernetes (K8s) is known as an Orchestrator for containers/microservies applications. If we talk about it from higher level, it is a cluster of nodes where applications are running. 
This cluster is also same like other clusters which is having a control plane and n number of nodes.

Control Plane (Master) : It is in charge for Kubernetes cluster that are having an API Server, Scheduler, Controller manager, Cluster Store (Key-Value Store)

Nodes : These are also known as minions or worker. This is the place where exactly application services run.



Note: Master and Nodes are Linux hosts that can be Physical, Virtual Machine or an instance on Cloud.

Let's talk about each components to the point:

Master: It is a collection of system services that makes up the control plane for the Kubernetes Cluster. For dev/test environment, Kubernetes Master services can be setup on single host but it is recommended to have multi-master (High-Availability) setup for Production environment.
        Even Master has all the ability to run an application but it not recommended to do so.

  • Kube-API Server:
                Kubernetes API server, a brain for Kubernetes cluster which handles communication with each component of Kubernetes. It validates and configures data for the API objects which include pods, services, replication controllers etc.

  • Kube-Controller Manager:
                Kube-Controller Manager keep an eye on the shared state of Kubernetes cluster and make sure that cluster always running in desired state. (Obtain desired state, Observe current state, find the difference and fix them)

  • Cluster Store:
                A highly available key/value store known as database of Kubernetes cluster. It stores persistent data as well as cluster state and configuration. It is a "source of truth" in case of failure.

  • Kube-Scheduler:
                Kubernetes scheduler is a policy-rich, topology-aware, workload-specific function that  significantly ensures availability, performance, and capacity. It watches API Server for any new pods initiation and assign them to healthy nodes.


Node/Worker: Nodes are worker for Kubernetes cluster and do the following tasks
  1. Communicate with Kube-API Server for any new work assignment
  2. Perform the work assigned by Kube-API Server        
  3. Confirm back to Master about the status
  • Kubelet
                Kubelet is the primary “node agent” that runs on each node. When we join any new node to Kubernetes cluster, the process involves installation of Kubelet which is later responsible of registration of node.

  • Pods
                Pod is a logical unit which hosts all the containers on which application services run. A pod can have one or many containers.
  • Kube-proxy
                It's kind of IP table which manages the load between pods and handling routing with in Nodes. It make sure that every node gets it own IP address.

  • Container Runtime
                Every node in the cluster need a container runtime to manage tasks related containers like creation, deletion, start and stop. Earlier Kubernetes had native support for Docker but now it is moved to CRI (Container Runtime Interface) which is plugin-model that allow Kubernetes to use third party Container Runtime.


Kubernetes DNS: Kubernetes cluster has its internal DNS service which is very important for its operations. Kubernetes DNS service has static IP address which hard-coded to every pod in the cluster. Kubernetes DNS schedules a DNS Pod and Service on the cluster, and configures the kubelets to tell individual containers to use it to resolve DNS names.
                Every new service automatically registered with the Kubernetes DNS service, so other components can easily find the every service by name.

Note: Kubernetes DNS is based on CoreDNS. (https://coredns.io/)

















Comments

Popular posts from this blog

Free Courses - Git & GitHub (DevOps)

6 FREE courses to learn AWS & AWS DevOps (Concepts + Hands-on + Interview)