Architecture of Kubernetes
The architecture of Kubernetes is designed to make it easy to deploy, scale, and manage containerized applications. It consists of different components that work together to provide a flexible and robust platform.
A cluster contains at least one master and one worker node, or one master and multiple worker nodes.
Master Node Components
The master node runs a set of processes in Kubernetes that ensure the smooth functioning of the cluster, known as the Control Plane.
A cluster can have one or more master nodes.
API Server
The API server is the central control plane component that runs the Kubernetes API. It serves as the entry point for all administrative tasks, validating and configuring data for API objects such as Pods, services, and controllers.
Users or admins communicate with the API server to execute different tasks through kubectl.
Etcd
Etcd is a database that stores all data, including cluster configurations, pods, and other details.
The data is stored in key-value format.
It is fully replicated, fast, and secure.
Controller Manager
The controller manager ensures that the desired state matches the actual state, making sure everything is in place.
It checks background processes and handles routine tasks in the cluster.
If Kubernetes runs on the cloud, it will be the Cloud Controller Manager.
If Kubernetes runs on non-cloud environments, it will be the Kube-Controller Manager.
Node Controller - responsible for node setup and their state.
Route Controller - responsible for setting up the network.
Service Controller - responsible for load balancing.
Volume Controller - responsible for creating and mounting volumes.
Kube Scheduler ( Action )
This component runs actions across the entire cluster, like assigning nodes to newly created pods.
It acts based on resource availability and tolerations.
Worker Node
Kubelet
Kubelet monitors the desired state of the Pod and communicates with the API server for any changes.
Kubelet runs on every node and keeps track of everything on the node.
Uses port number 10255.
Sends success or failure reports to the master.
Kube-Proxy
Kube-proxy is a network proxy that runs on each worker node, assigning IPs to Pods.
It maintains network rules on nodes, allowing communication to and from pods both inside and outside the cluster.
Kube-proxy handles traffic routing and load balancing for services.
Container Engine
The container engine works with Kubelet to pull images and start or stop containers.
Exposes the container according to the given manifest.
POD
It is the smallest unit in Kubernetes.
A Pod is a group of one or more containers deployed on the same host.
In Kubernetes, the control unit is the Pod, not the container, meaning the master works with Pods, not containers.
Containers cannot start without a Pod.
One Pod usually contains one container.
Multi-container Pods share the same volume, connect on the same local host, and access the same memory space.
There is no default auto-healing or scaling.
To summarize this article, we have explored the architecture of Kubernetes and its various components.
Thank you for your time today. See you soon! ๐