Kubernetes Architecture
Hello , I am Sushant Lad , a passionate DevOps engineer who is keen to learn new things and make a impactful contribution to the DevOps community.
When I first started learning, I was skeptical about how I would begin. Would it be hard or easy to learn? Which concepts should I start with? Should I go with documentation, or should I watch some videos on YouTube? When I started learning, I watched many YouTube videos, and one day I stumbled upon a video series by Abhishek Veeramalla. He started with Kubernetes Architecture without jumping straight into the core concepts of Kubernetes.
It is important to know that whenever you start learning new concepts, begin from the very basics. I have seen people struggle with explaining the Kubernetes architecture, which is so crucial to understand as it creates a solid first impression. If you are attending interviews, this question will likely be asked. In almost every interview I attended, the interviewer asked about the architecture. In this article, I will briefly explain the K8s Architecture.
The Kubernetes architecture mainly consists of 3 major components:-
Client
Control plane
Data plane
Client - Mainly used to interact with the cluster via API server. “kubectl“ is used to communicate with k8s cluster. Provides instructions to control control pane for creating pods, services or any other update.
Control plane - Control plane mainly consists of
API server - API server is the heart of the Control plane. It receives instruction from kube-client and takes appropriate decision and sends the request to either controller manager or scheduler (based on the request). It is the task of the API to decide on which node the pod to be scheduled. No request can be directly passed to the cluster, it has to be passed through the API Server
Scheduler - The primary task of scheduler is the schedule the pods on a node. It takes instructions from API server and appropriately schedules the action of pod creation.
Controller manager - The controller manager manages the controllers in Kubernetes. The various controllers in Kubernetes include ReplicaSet (rs), Deployment, Service controller, Node controller, and many more. It is the duty of the controller manager to ensure the controllers are running and the desired state is maintained on the cluster.
etcd - etcd is the key-value data store. It stored all the details related to cluster
Data plane - Data plane consists of
kubelet - kubelet acts as an interpreter between the API server and the data plane. It continuously monitors the pods and ensures that pods are running. If any pod is down, it informs the API server to take action immediately.
kube-proxy - kube-proxy takes care of the networking between pods and maintains the route table. It also maintains the IP addresses and load balancing. It has intelligent logic to forward requests to the right pod in the worker node.
Pods - Pods are the smallest deployable unit. It runs one or more containers inside
Container runtime - A container runtime is needed to run the application containers inside pods. It is not mandatory to use Docker as the container runtime; other container runtimes are available in the market, such as CRI-O, Podman, etc.