Kubernetes 05: The Scheduler

Sits under the build in Build Your Own Kubernetes - From Scratch. Follows Kubernetes 04: Objects and Controllers, which made pods exist; this lesson is what gives a pod a home.
Before you start. This series builds a small copy of Kubernetes, a program that keeps a fleet of machines running the programs you asked for, and restarts them when they die. Kubernetes calls one running copy of a program a pod, one machine in the fleet a node, and the whole fleet together the cluster. So far, our small copy already keeps asking whether what is running matches what was asked for, and closes the gap when it does not (Kubernetes 02: The Reconcile Loop); and it can create a pod as a row in its record, with one field left empty where a node’s name should go (Kubernetes 04: Objects and Controllers). This lesson is entirely about how that field gets filled in.