Control plane & node components
Explain what the API server, etcd, scheduler, controller manager and kubelet each do.
By Invicly Tech, , in Kubernetes Administrator (CKA). About 8 minutes to read.
In short
The control plane stores and decides cluster state, and worker nodes run Pods. The API server is the only component that talks to etcd, and every other component watches the API server. In kubeadm clusters the control plane runs as static Pods defined in /etc/kubernetes/manifests.
Explained simply
A Kubernetes cluster has a brain and a body. The brain is the control plane: it stores what you asked for and decides what should happen. The body is the worker nodes: they run your containers. The two talk only through one front door, the API server.
Picture a busy office with one reception desk. Every request, from you or from any internal team, goes through reception (the API server). Reception writes everything in one ledger (etcd). Teams like scheduling and maintenance keep checking the ledger for new work and act on it.
This design means no component gives orders directly to another. Each one watches for changes it cares about and quietly does its own job. That is why Kubernetes heals itself: if reality drifts from the ledger, some component notices and fixes it.
Press Play on a diagram to walk through it one step at a time.
- 1kube-apiserver
Front door: authenticates, validates and stores objects.
- 2etcd
Key-value store holding all cluster state.
- 3Scheduler and controllers
Assign Pods to nodes; reconcile desired state.
- 4kubelet
Node agent that runs Pods via the container runtime.
- 5kube-proxy and CNI
Service routing rules and Pod networking.
- kubectl to API server: POST Deployment1POST Deployment
- 2Persist to etcdAPI server to API server: Persist to etcd
- Controllers and scheduler to API server: Controller creates ReplicaSet, Pods3Controller creates ReplicaSet, Pods
- Controllers and scheduler to API server: Scheduler binds Pod to node4Scheduler binds Pod to node
- kubelet to API server: Watch sees Pod for its node5Watch sees Pod for its node
- 6Start containers via CRIkubelet to kubelet: Start containers via CRI
- kubelet to API server: Report Pod status7Report Pod status
- 1Request
kubectl sends HTTPS to port 6443
- 2Authentication
Who is this? Cert or token
- 3Authorization
RBAC: may they do this?
- 4Mutating admission
Add defaults, inject fields
- 5Validating admission
Quotas, policies, schema
- 6Store in etcd
Then watchers are notified
- Static Pods (control plane)
- kube-apiserver
- etcd
- kube-scheduler
- kube-controller-manager
- systemd services (every node)
- kubelet
- containerd
- DaemonSets
- kube-proxy
- CNI agent (Calico, Cilium)
- Deployment
- CoreDNS
In depth
What happens inside one API request
Every request to the API server passes the same checkpoints. Authentication works out who you are, from a client certificate, a token or another method. Authorization, usually RBAC, decides if that identity may perform this verb on this resource. Admission controllers then run: mutating ones may change the object (for example, adding a default StorageClass), and validating ones may reject it (for example, a ResourceQuota that would be exceeded).
Only after all checks pass does the API server write the object to etcd and send back a reply. A failure at each step gives a different error: 401 for authentication, 403 for authorization, and a descriptive admission error for policy problems.
- 401 Unauthorized: unknown identity
- 403 Forbidden: RBAC said no
- Admission errors name the controller that refused
Watches and controllers
Components do not poll the API server over and over. They open a watch: a long-lived connection that streams every change to the resources they care about. The scheduler watches for Pods with no node. The kubelet watches for Pods assigned to its node. Each controller in kube-controller-manager watches its own kinds.
A controller runs a reconcile loop: compare desired state with actual state, then act to close the gap. The ReplicaSet controller counts Pods and creates or deletes some. The Node controller marks nodes NotReady when they stop reporting. Because loops repeat forever, a missed event is fixed on the next pass.
- 1Watch
Stream of Pod and ReplicaSet changes
- 2Count
Pods matching the selector
- 3Compare
Actual count vs spec.replicas
- 4Act
Create or delete Pods to close the gap
- Back to step 1
Leader election and Leases
In a cluster with several control plane nodes, you get several schedulers and controller managers. If all of them acted at once they would fight. So they elect a leader using a Lease object in kube-system. Only the leader works; the others wait and take over if the leader stops renewing its lease.
Nodes also use Leases: each kubelet renews a Lease in kube-node-lease every few seconds as a cheap heartbeat. You can see these with kubectl get lease -A.
- Scheduler A to Lease in kube-system: Acquire: A is leader1Acquire: A is leader
- Scheduler B to Lease in kube-system: Try: held by A, so wait2Try: held by A, so wait
- Scheduler A to Lease in kube-system: Renew regularly3Renew regularly
- Scheduler B to Lease in kube-system: A stopped renewing: take over4A stopped renewing: take over
- Lease in kube-system to Scheduler B: B is now leader5B is now leader
Ports worth recognising
Port numbers show up in manifests, firewall tasks and error messages, so it helps to know the defaults.
- 6443: kube-apiserver
- 2379 and 2380: etcd clients and etcd peers
- 10250: kubelet API (logs, exec)
- 10257 and 10259: controller manager and scheduler
- 30000 to 32767: NodePort range
Learn it in 4 short steps
About 45m each. Track them with a timer in your plan.
- 1Explain the API server and etcd~45m
- 2Explain the scheduler and controller manager~45m
- 3Explain kubelet and kube-proxy~45m
- 4Find component manifests on a node~45m
Key points
- Only the API server reads and writes etcd.
- The scheduler only picks a node; the kubelet actually starts containers.
- kube-controller-manager runs many controllers, such as Deployment and Node controllers.
- Static Pod manifests live in /etc/kubernetes/manifests on control plane nodes.
- The kubelet runs as a systemd service, not as a Pod.
Key terms
Tap a card to flip it. 0/6 known
Examples
kubectl get pods -n kube-system -o wide
ls /etc/kubernetes/manifests
# etcd.yaml kube-apiserver.yaml
# kube-controller-manager.yaml kube-scheduler.yaml
grep staticPodPath /var/lib/kubelet/config.yaml
systemctl status kubeletSpotting which component is missing
You create a Deployment, but no Pods appear and no ReplicaSet exists. Step 1: the API server accepted the object, so it is up. Step 2: creating a ReplicaSet is the job of the Deployment controller inside kube-controller-manager. Step 3: check that Pod in kube-system. If ReplicaSets exist but Pods stay Pending with no events, suspect the scheduler instead.
k create deploy demo --image=nginx
k get rs -l app=demo # nothing
k -n kube-system get pods | grep controller-manager
k -n kube-system logs kube-controller-manager-cp1 --tail=20Reading the static Pod manifest of the API server
Step 1: on the control plane, list /etc/kubernetes/manifests. Step 2: grep the API server manifest for the flags you care about, such as the etcd address and the Service IP range. This is how you answer questions like "what is the cluster's Service CIDR" without guessing.
ls /etc/kubernetes/manifests
# etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yaml
grep -E 'etcd-servers|service-cluster-ip-range' \
/etc/kubernetes/manifests/kube-apiserver.yamlQuick reference
- Only kube-apiserver talks to etcd; everything else talks to the API server
- Request order: authentication, authorization, admission, then etcd
- Scheduler down: new Pods Pending with no scheduling events
- Controller manager down: Deployments create no ReplicaSets or Pods
- k get lease -n kube-system shows scheduler and controller manager leaders
- Ports: 6443 API, 2379/2380 etcd, 10250 kubelet
Common mistakes
- Looking for the kubelet in kube-system Pods; it is a systemd service.
- Deleting a static mirror Pod with kubectl and expecting it to stay gone.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
List every Pod in kube-system with the node it runs on, and say which ones are static Pods.
- Exercise 2medium
Find out which control plane node currently holds the scheduler leader lease.
- Exercise 3hard
Write the cluster's Service CIDR and Pod CIDR to /opt/cidrs.txt using only information on the control plane node.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Why is the kubelet not a Pod like the other components?
- The kubelet is what starts Pods, including static Pods, so it has to exist before any Pod can run. That is why systemd runs it.
- What happens to running apps if the control plane goes down?
- Running containers keep running, because kubelets and runtimes work locally. But nothing new can be scheduled, scaled or healed until the control plane is back.
- Can I talk to etcd directly to change objects?
- You should not. Always go through the API server so authentication, validation and watchers all work. etcdctl is for backup, restore and health checks.