Kubernetes Architecture Explained

Kubernetes is

  •  a container orchestrator
  • on a high-level view the Kubernetes can be divided into three parts.
  1. Control Node or Master
  2. Worker Node
  3. Pods

    kubernetes architecture diagram

Master Node:

The Master Node or control node is the one that manages and controls the Kubernetes cluster. As per the scale of the cluster, there can be more than one master node.

The master node has the below components:

API-server

  • Main communication hub of the cluster
  • The API server is the one responsible for receiving and processing the API calls.
  • API server validates the request and process it ,if it is valid
  • kubectl binary can be used to send requests to the api server
  • Kube API server can be accessed through REST calls via API, if we are not planning to use kubectl binary

Scheduler

  • The scheduler as the name says, is the one who is responsible for scheduling pods on the nodes.
  • Scheduler is responsible for distributing the workload.
  • Scheduler tracks the resource utilization on the cluster nodes
  • Scheduler checks for affinity and taints before scheduling a pod to the node

Etcd

  • Etcd is key-value storage, where the  Kubernetes cluster data like pod details, secrets, namespace, etc.
  • the key-value pairs stored in the etcd are not encrypted.
  • Etcd can be accessed via api-server only
  • Etcd is a distributed data store

Control Manager

  • Control Manager is a collective of multiple controllers which manage different areas.
  • Control Manager is a daemon which runs and watches the state of the cluster and makes required changes based to keep the cluster in the desired state
  • Control Manager includes replication controller, endpoint controller, namespace controller, and service account controller.

Worker Node :

Container Runtime

  • Container runtime is responsible for controlling the lifecycle of the containers.
  • some of the container runtime available are docker, cri-o, qemu, kvm2 etc.

Kubelet service

  • Kubelet is the agent that runs on all the nodes. Kubelet interacts with the container runtime and  starts the pods on the worker node as and when the scheduler  in the master node schedules the pod
  • Kubelet agent continuously communicate with Kubernetes API server to transfer info on the health of the pods
  • Kubelet interact with etcd store to read configuration details
  • Kubelet process manages network rules , port forwarding etc.

Kube proxy

  • Maintains the network configuration. As per the requirement, kubeproxy forwards or filters the traffic.
  • The incoming requests are forwaded to the containers and will act as a initial level load balancer
  • Kube proxy is responsible for networking between the isolated networks inside or outside of the clusters

 

Pods

  • One or more containers in a logical group
  • Pod can be considered as a single instance of the application/service
  • Pod is the basic building block or unit of work
  • Pods are ephemeral; no pod is ever "redeployed"; But can be connected to persistent storage, if we need to preserve the state

Search on LinuxDataHub

Leave a Comment