In this guide, we’ll break down Kubernetes architecture into practical components to help you understand how it orchestrates containerized applications at scale. Whether you’re new to Kubernetes or aiming to refine your expertise, this guide offers actionable insights drawn from real-world experience.
If you’re not yet familiar with Kubernetes or container orchestration, I recommend reading my earlier article:
Kubernetes for Beginners: Making Sense of Container Orchestration in DevOps. It provides a solid foundation to help you grasp the “why” behind Kubernetes.
What Is Kubernetes Architecture?
Imagine Kubernetes as a supercharged version of Docker. If Docker is like running containers manually on your laptop, Kubernetes is like having an automated, highly organized team that ensures your containers are always deployed, monitored, and scaled efficiently.
Kubernetes architecture consists of two main parts:
- The Control Plane – The mastermind overseeing everything.
- The Worker Nodes – The hands-on team running the containers.
Let’s break it down by comparing it to Docker components you might already know.
The Control Plane: The Mastermind
If Docker Compose is your tool for managing multiple containers, think of the Control Plane as the “Docker Compose on steroids.” It doesn’t just orchestrate containers—it keeps the entire cluster healthy and responsive.
-
API Server:
The API Server is like Docker’s CLI or REST API. It’s your main interface to Kubernetes. Instead of runningdocker run
commands, you send requests to the API Server, and it tells the cluster what to do. -
Scheduler:
Remember how you manually decide which container should run on which server when using Docker? The Scheduler automates that for you. It analyzes the available resources in your cluster and assigns workloads (Pods) to the best-fit Worker Nodes. -
etcd:
Think of etcd as Docker’s storage for container configurations, but much more advanced. It stores the entire state of the Kubernetes cluster—like a logbook of what’s running, where, and how it should behave. -
Controller Manager:
If you’ve ever written a bash script to restart a Docker container when it crashes, the Controller Manager is the automated version of that. It continuously monitors the cluster and takes action to maintain the desired state (e.g., restarting Pods if they fail).
The Worker Nodes: The Doers
Worker Nodes are where the actual magic happens containers run here. If the Control Plane is your Docker management system, Worker Nodes are the machines where your docker run commands execute.
-
Kubelet:
This is like the Docker Daemon, which runs on each node and manages the containers. The Kubelet listens to the Control Plane and ensures the containers are running exactly as specified. -
Kube-proxy:
Imagine the complexities of networking in Docker Swarm, where you manage overlay networks and service discovery. Kube-proxy simplifies this by automatically routing traffic within the cluster, ensuring services can communicate seamlessly. -
Container Runtime:
The Container Runtime is the heart of a Worker Node. It’s what actually runs your containers. If you’ve used Docker Engine before, this is the Kubernetes equivalent. Other runtimes like containerd or CRI-O can also be used here.
Below is a simple block diagram to help you visualize the Kubernetes architecture:
Control Plane (Master Node)
---------------------------
| API Server | <- Docker CLI/API equivalent
| Scheduler | <- Automated workload placement
| etcd (Cluster State) | <- Advanced state storage
| Controller Manager | <- Automated "bash scripts"
---------------------------
|
v
Worker Nodes (x N)
---------------------------
| Kubelet | <- Docker Daemon equivalent
| Kube-proxy | <- Networking made simple
| Container Runtime | <- Docker Engine/Runtime
---------------------------
The Role of Kubernetes Architecture
Kubernetes architecture builds on the familiar concepts of Docker but adds powerful features like:
- Automating where containers are placed.
- Healing itself when something fails.
- Scaling workloads up or down automatically.
In short, Kubernetes transforms container management from a manual process into an elegant, automated system designed for reliability and scalability.
Control Plane Components
The Control Plane is the brain of the Kubernetes cluster, managing everything from workloads to Worker Nodes. Think of it as the decision maker that keeps everything organized, healthy, and running smoothly. Each component has a specific role, working together like a well-oiled machine.
-
The API Server
is the main communication hub for Kubernetes. It’s where all requests—whether fromkubectl
, CI/CD pipelines, or other tools—are sent to interact with the cluster. We can also called it the cluster gateway.
What It Does: Processes requests to create, delete, or update cluster resources like Pods and Nodes.
When you usekubectl apply -f deployment.yaml
, the API Server ensures the cluster understands and implements your request. -
etcd: The Memory Bank
etcd is Kubernetes’ memory bank a consistent, distributed key-value store that holds all the data about your cluster.
Function: Tracks both the desired state (what you want the cluster to do) and the actual state (what’s currently happening).
etcd ensures Kubernetes knows which Pods are running and where, so if a Node fails, the cluster can recover seamlessly. -
Scheduler: The Matchmaker
The Scheduler is Kubernetes’ matchmaker, deciding where new workloads (Pods) should run.
Assigns Pods to Worker Nodes based on available resources and other requirements like CPU, memory, or specific labels.
For example, if you deploy a web app, the Scheduler ensures it runs on a Node with enough free memory and CPU to handle the workload.
- Controller Manager: The State Keeper
The Controller Manager is Kubernetes’ state enforcer, ensuring that the cluster’s actual state matches its desired state.
Runs controllers (small programs) that handle specific tasks, like creating new Pods if one fails or scaling replicas up or down.
If you specify 5 replicas for a deployment but one Pod crashes, the Deployment Controller ensures a new Pod is created to maintain the desired count.
Quickie Points
Let’s simplify the Control Plane components with a quick Q&A-style breakdown:
Who decides the information?
→ API Server: Acts as the communication hub, deciding how information flows within the cluster.
Who remembers everything?
→ etcd: The memory bank, storing all cluster data in a consistent, distributed key-value store.
Who acts on the information?
→ Scheduler: Assigns workloads (Pods) to the best available Worker Nodes.
Who ensures everything runs smoothly?
→ Controller Manager: Maintains the desired state of the cluster, fixing any discrepancies automatically.
Worker Node Components
The Worker Nodes are the essential components of the Kubernetes cluster where your actual applications (containers) run. These Nodes execute the workloads assigned by the Control Plane and ensure everything is functioning as expected.
– Kubelet: The Supervisor
The Kubelet is like the supervisor of the Worker Node, ensuring that containers are running as defined.
Constantly communicates with the Control Plane to ensure the desired state of Pods is achieved.
If a container crashes, the Kubelet ensures it is restarted as per the Pod specification.
– Kubelet: The Supervisor
The Kubelet is like the supervisor of the Worker Node, ensuring that containers are running as defined.
Constantly communicates with the Control Plane to ensure the desired state of Pods is achieved.
Take for instance, a container crashes, the Kubelet ensures it is restarted as per the Pod specification.
– Container Runtime: The Executor
The Container Runtime is the software that actually runs your containers, such as Docker or containerd.
Pulls container images, starts containers, and manages their lifecycle.
For example, when you deploy a Pod, the Container Runtime pulls the necessary images and spins up the containers.
Quickie Points
Who ensures containers are running as planned?
→ Kubelet: The supervisor that keeps everything aligned with the Control Plane’s instructions.
Who directs traffic to the right place?
→ Kube-proxy: The traffic manager that ensures network requests reach the right Pods.
Who makes containers run?
→ Container Runtime: The executor that pulls images and starts your applications.
Thanks for reading
In the next post, we’ll explore more key concepts in Kubernetes, stay tuned !