This is one of the most important chapters in your Kubernetes journey.
After this chapter, you should understand what is happening inside Kubernetes when you run:
kubectl apply -f deployment.yamlWe'll go from the big picture → individual components → complete request flow.
A Kubernetes environment is called a Cluster.
A cluster generally consists of:
Kubernetes Cluster
│
┌─────────────┴─────────────┐
│ │
Control Plane Worker Nodes
│ │
┌──────┼──────┐ ┌─────────┼─────────┐
│ │ │ │ │ │
API Scheduler etcd Node 1 Node 2 Node 3
Server
│ │
│ ├── Pod
│ ├── Pod
│ └── Pod
│
ControllersThink of it as:
Control Plane = Brain
Worker Nodes = Workers that run your applications
This distinction is fundamental.
The Control Plane makes decisions about the cluster.
It handles things like:
Worker Nodes actually run your workloads.
For example:
Worker Node
│
├── Pod
│ └── Node.js container
│
├── Pod
│ └── Python container
│
└── Pod
└── Nginx containerThe major components are:
Control Plane
│
├── kube-apiserver
├── etcd
├── kube-scheduler
└── kube-controller-managerWe'll understand each.
The Kubernetes API Server is the primary entry point into the Kubernetes control plane.
You interact with Kubernetes through the API.
For example:
kubectl get podsor:
kubectl apply -f deployment.yamlYour request goes approximately like:
You
│
↓
kubectl
│
↓
Kubernetes API ServerThe API Server then coordinates access to the cluster's state.
Almost everything communicates through the Kubernetes API.
For example:
kubectl
↓
API Server
Scheduler
↓
API Server
Controllers
↓
API Server
Kubernetes clients
↓
API ServerSo you can think of the API Server as the front door of the Kubernetes control plane.
This is another extremely important component.
etcd is Kubernetes' distributed key-value store.
It stores the cluster's state.
For example, Kubernetes needs to know:
How many Pods should exist?
Which Deployments exist?
Which Nodes exist?
What configuration exists?
What is the current state?Much of this cluster state is stored in etcd.
Conceptually:
API Server
│
↓
etcd
│
┌─────────┼─────────┐
↓ ↓ ↓
Cluster Pods Deployments
stateThink of etcd as the Kubernetes database for cluster state.
Don't treat it as your application's PostgreSQL/MongoDB database.
It is for Kubernetes' own state.
Now imagine you create a Pod:
I need one Pod.But your cluster has:
Node 1
Node 2
Node 3Which node should run it?
That's where the Scheduler comes in.
New Pod
↓
Scheduler
↓
Choose suitable Node
↓
Node 2The Scheduler considers things such as:
We'll study these later.
This component contains controllers that continuously work to move the cluster toward the desired state.
Remember our earlier concept:
Desired State ≠ Current StateThe controllers try to reconcile that difference.
Example:
You want:
3 PodsCurrent state:
2 PodsA controller notices:
Desired = 3
Current = 2and takes action so that eventually:
Current = 3Conceptually:
Desired State
↓
Controller
↓
Compare
↓
Current State
↓
Take actionThis reconciliation loop is one of the central ideas behind Kubernetes.
Now let's look at a Worker Node.
A simplified node looks like:
Worker Node
│
├── kubelet
│
├── kube-proxy
│
├── Container Runtime
│
└── PodsLet's understand each.
kubelet is the agent running on each worker node.
Its job is to make sure the Pods assigned to that node are running as expected.
Think:
Control Plane
↓
"Run this Pod on Node 1"
↓
kubelet
↓
Container Runtime
↓
ContainerThe kubelet communicates with the Kubernetes API Server and manages the workloads assigned to its node.
The container runtime is responsible for actually running containers.
Examples include:
containerd
CRI-OConceptually:
Kubernetes
↓
kubelet
↓
Container Runtime
↓
ContainerYou don't need to memorize runtime internals yet.
Just remember:
kubelet manages Pods on the node; the container runtime runs the containers.
kube-proxy is involved in implementing Kubernetes Service networking on nodes.
For example:
Client
↓
Service
↓
PodIt helps establish the networking rules that allow traffic to reach the appropriate backend Pods.
Modern Kubernetes networking can involve other components too, so don't think of kube-proxy as "the entire networking system."
For now:
kube-proxy helps implement Service networking.
Now combine everything:
Kubernetes Cluster
│
┌──────────────────┴──────────────────┐
│ │
CONTROL PLANE WORKER NODES
│ │
┌────────┼─────────┐ ┌─────────┴─────────┐
│ │ │ │ │
API Scheduler Controller Node 1 Node 2
Server Manager Manager │ │
│ │ │
└─────── etcd │ │
│ │
kubelet kubelet
│ │
Container Runtime Container Runtime
│ │
Pods PodsNow let's see what actually happens.
Suppose you create:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latestDon't worry if some of this YAML looks unfamiliar.
We'll learn it properly in later chapters.
The important part is:
replicas: 3You're saying:
"I want three replicas of this application."
You execute:
kubectl apply -f deployment.yamlWhat happens?
Let's follow it.
You
↓
kubectl
↓
API Serverkubectl communicates with the Kubernetes API Server.
The API Server processes the request.
It checks things such as:
If accepted, the desired configuration becomes part of the cluster state.
The cluster state is stored through the API Server in etcd.
Conceptually:
kubectl
↓
API Server
↓
etcd
↓
Deployment should exist
replicas = 3Now Kubernetes knows:
"The desired state is 3 replicas."
The appropriate controller sees the Deployment.
The Deployment controller works toward the desired state.
Eventually the workload hierarchy becomes:
Deployment
↓
ReplicaSet
↓
3 PodsSo you don't normally manually create three Pods.
The Deployment manages the desired number of replicas.
The Pods need to be placed on worker nodes.
The Scheduler sees unscheduled Pods:
Pod 1 → ?
Pod 2 → ?
Pod 3 → ?It evaluates the available nodes.
For example:
Node 1 → 4 CPU available
Node 2 → 2 CPU available
Node 3 → 8 CPU availableIt chooses suitable nodes according to scheduling rules.
Maybe:
Pod 1 → Node 1
Pod 2 → Node 2
Pod 3 → Node 3Suppose Pod 1 is assigned to Node 1.
The kubelet on Node 1 learns about it.
API Server
↓
Node 1
↓
kubeletThe kubelet makes sure the Pod is actually created.
The kubelet works with the container runtime.
kubelet
↓
containerd / CRI-O
↓
Pull nginx image
↓
Create container
↓
Start containerNow:
Pod
└── nginx containeris running.
This is worth memorizing:
kubectl apply
↓
API Server
↓
etcd
↓
Controller
↓
Pod created
↓
Scheduler
↓
Node selected
↓
kubelet
↓
Container Runtime
↓
Container
↓
Pod RunningThis is one of the most important flows in Kubernetes.
Suppose:
Desired:
3 Pods
Current:
3 PodsEverything is good.
Then:
Pod 2 ❌Now:
Desired = 3
Current = 2The Kubernetes controllers detect the difference.
They work to restore:
Current = 3Eventually:
Pod 1 ✅
Pod 2 ❌
Pod 4 ✅
Pod 3 ✅The exact mechanics depend on the workload type, but the key idea is reconciliation.
This is a bigger failure.
Suppose:
Node 1 ❌and it was running:
Pod A
Pod B
Pod CKubernetes can detect that the node is unhealthy.
For workloads managed by controllers such as Deployments, Kubernetes can work toward recreating the required Pods on healthy nodes.
Node 1 ❌
↓
Pods unavailable
↓
Controllers reconcile desired state
↓
Healthy Nodes
↓
New PodsThis is part of Kubernetes' self-healing behavior.
Imagine the Control Plane temporarily loses a component.
Kubernetes needs persistent cluster state.
That's why etcd is critical.
Conceptually:
etcd
│
Cluster State
│
┌────────┼────────┐
↓ ↓ ↓
Deployments Nodes PodsIn production, etcd must be handled carefully because losing its data can affect the cluster.
Managed Kubernetes services such as EKS/GKE/AKS generally manage the control-plane infrastructure for you.
A useful mental model:
CONTROL PLANE
│
┌───────────┼───────────┐
↓ ↓ ↓
API Server Scheduler Controllers
│ │ │
└───────────┼───────────┘
↓
Cluster StateAnd:
WORKER NODE
│
┌───────────┼───────────┐
↓ ↓ ↓
kubelet kube-proxy Runtime
│ │
└───────────┬───────────┘
↓
PodsYou can think of the Kubernetes API as the communication hub.
API SERVER
│
┌─────────────┼─────────────┐
↓ ↓ ↓
kubectl Scheduler Controllers
│
↓
NodesThis is why Kubernetes is often described as an API-driven system.
The components responsible for managing the Kubernetes cluster's state and making orchestration decisions.
It exposes the Kubernetes API and serves as the primary entry point for interacting with the cluster.
A distributed key-value store used to persist Kubernetes cluster state.
It selects an appropriate node for unscheduled Pods.
It is the agent on each node that makes sure Pods assigned to that node are running as expected.
It helps implement Kubernetes Service networking on nodes.
The software responsible for running containers, such as containerd or CRI-O.
kubectl apply?#At a high level:
kubectl
↓
API Server
↓
Cluster state
↓
Controllers
↓
Scheduler
↓
kubelet
↓
Container Runtime
↓
ContainerMemorize this diagram:
KUBERNETES CLUSTER
│
┌──────────────┴──────────────┐
│ │
CONTROL PLANE WORKER NODE
│ │
┌─────┼─────┐ ┌──────┼──────┐
│ │ │ │ │ │
API Sched etcd kubelet proxy runtime
│
Controllers
│
↓
PodsAnd remember the responsibilities:
API Server → Communication / API
etcd → Cluster state
Scheduler → Choose node
Controllers → Reconcile desired state
kubelet → Manage Pods on node
Runtime → Run containers
kube-proxy → Service networkingBefore Chapter 4, try answering these without looking back:
1. You create a Pod. Who decides which Node it should run on?
2. What stores Kubernetes cluster state?
3. What component runs on every worker node and manages Pods?
4. What actually runs the container?
5. If desired replicas = 5 but only 4 are running, what Kubernetes concept works to correct this?
kubectl#Now we move from theory to actually controlling Kubernetes.
You'll learn commands like:
kubectl get pods
kubectl get nodes
kubectl describe pod
kubectl logs
kubectl exec
kubectl delete
kubectl apply
kubectl get allAnd we'll set up a local Kubernetes cluster so you can actually run these commands rather than just reading about them.
Mark it as complete to track your mastery.