Kubernetes 03: Store and Watch

Follows Kubernetes 02: The Reconcile Loop, which needed to observe the world; this is the thing it observes.
Before you start. This series builds a small copy of Kubernetes: a program that keeps a fleet of machines (a cluster) running the programs you asked for, and restarts them when they die. So far our build can write down what should be true instead of listing steps, and it has a controller, a loop that checks what is true against what should be true and nudges the two closer, pass after pass. Kubernetes 02: The Reconcile Loop left one question open: checking everything every pass does not scale, so where does “what is true” actually live, and how does a controller learn the moment it changes?