See how the control plane and nodes work together
In this task you'll understand what each part of a cluster does, so you know where to look when it breaks.
The control plane decides; the worker nodes do the work. In the control plane, the API server is the front door that everything talks to; etcd stores the cluster's state; the scheduler picks a node for each new pod; and the controller manager runs loops that keep making reality match what you asked for (for example, three replicas).
On every node, the kubelet starts and watches the node's pods through the container runtime (such as containerd), and kube-proxy (or a CNI plugin such as Cilium) handles service networking. In AKS, Microsoft runs the control plane for you; you see and manage the nodes.
Example. When a Kestwick Hotels booking pod kept vanishing, the engineer knew where to look: the ReplicaSet controller recreated it, the scheduler placed it, and the kubelet's events on that node showed the image pull failing.
Before you start
You need: Docker Desktop and kind on your computer (both free). Time: 25 minutes.
Where to look
- Terminal
- kubectl
Steps
- List the control plane's own pods:
kubectl get pods -n kube-system -o wide. - Find the API server, etcd, scheduler and controller manager pods, and note they all run on the control-plane node.
- Create a deployment with 3 replicas, delete one pod, and watch a new one appear: that's a controller at work.
- Run
kubectl get events --sort-by=.lastTimestampand follow one pod from Scheduled to Pulled to Started. - See who's leader:
kubectl get lease -n kube-systemlists the leases the scheduler and controller manager hold.
Commands
kubectl get pods -n kube-system -o wide
kubectl create deployment web --image=nginx --replicas=3
kubectl delete pod -l app=web --wait=false | head -1
kubectl get events --sort-by=.lastTimestamp | tail -15
kubectl get lease -n kube-system
Watch out for
- Cost
- Free on kind.
- Security
- Access to etcd, or to the API server as an admin, is access to every secret in the cluster.
- Common mistakes
- Thinking the scheduler starts pods (it only chooses the node; the kubelet starts them).
Clean up
Delete the test deployment, or the whole kind cluster.
Words to know
- Control plane
- The parts that make decisions for the cluster: API server, etcd, scheduler and controller manager.
- etcd
- The key-value database that stores the cluster's state, kept consistent across members with the Raft algorithm.
- Controller
- A loop that compares what you asked for with what exists, and acts to close the gap.
- kubelet
- The agent on each node that starts, watches and reports on that node's pods.
Tick off each step and track your progress in the guide.
Open this task in DevOps, Hands On