Machine Room

Kubernetes control plane

Who decides where your app runs: the API server, etcd, the controller manager, the scheduler and the kubelet, one request step by step, and what happens when a machine dies. The one-page notes from the reel.

Download the PDF

One-page notes, Kubernetes control plane. Nobody hands out the work. Every part watches the API server. 1, The map: a dashed box labelled control plane holds the API server in the middle, joined by one line each to etcd (a database cylinder), the controller manager and the scheduler. A terminal card, you, replicas: 3, sends an arrow into the API server. Below the box, node-1, node-2 and node-3, each with a kubelet tag, each joined to the API server. Every part talks only to the API server: hub and spoke. Only the API server reads and writes etcd. The kubelet runs on every machine, outside the control plane. 2, One request: replicas: 3, as four cards. API server (desired = 3): sees your request, replicas: 3; does: checks it, saves it in etcd. Controller manager (Pending, no machine yet): sees desired 3, running 0; does: asks for 3 Pods. Scheduler (Pod 1 to node-2): sees Pods with no machine; does: rules out machines without enough CPU or memory, scores the rest, picks the highest, tells the API server. Kubelet on node-2 (Running): sees a Pod for its machine; does: pulls the image, starts your app, reports back. 3, A machine dies, as a table of what happens, desired and running: node-2 dies, Pod 1 is gone, 3 and 2; controller manager: 3 is not 2, asks for Pod 4, 3 and 2; scheduler picks node-3, its kubelet starts Pod 4, 3 and 3. In a real cluster, Kubernetes waits a few minutes before treating a machine as dead. 4, The real names: one copy of your app = Pod; what you asked for = Deployment, then ReplicaSet, then Pods; ruling out, then ranking = Filtering, Scoring; the scheduler's decision = binding; downloading your app = pulling the image. A loop of watch, compare, fix: that's a control loop: watch the API server, compare with what you asked for, fix the difference.

On a phone, press and hold the image to save it.