kind & Setup
A multi-node cluster in Docker, the platform bootstrap, and the lab runner
Everything in this module lives in kubernetes/ in the repository.
kind (Kubernetes in Docker) runs each cluster node as a Docker
container that contains a kubelet, a container runtime, and (on the control
plane) the control-plane components. It's how Kubernetes itself is tested,
and it gives you a real multi-node cluster on a laptop.
Tools
brew install kind helm kubernetes-cli
kind version # kind v0.33.0
kubectl version --client # v1.37.1
helm version --short # v4.3.0OrbStack and Docker Desktop ship their own kubectl. The one here was
v1.33, and kubectl only supports API servers within one minor version of
itself, so it was too old for a 1.37 cluster. which -a kubectl shows
every copy on your PATH; the first one wins.
The minimal cluster
kind create cluster --config cluster.yaml --wait 120s # one node; --wait: until it's usable
kubectl get nodes
kind delete cluster --name minimalWithout --wait, the first kubectl run right after creation failed:
serviceaccount "default" not found. The cluster existed, but its
controllers hadn't created the namespace's default service account yet.
The production-shaped cluster
The zone labels are what cloud providers put on nodes in different availability zones. Spreading, disruption budgets and volume placement read them, so the labs behave like a three-zone cluster.
kind create cluster --config cluster_prod.yaml --wait 120s
kubectl get nodes -L topology.kubernetes.io/zone
NAME STATUS ROLES VERSION ZONE
lab-control-plane Ready control-plane v1.37.0
lab-worker Ready <none> v1.37.0 zone-a
lab-worker2 Ready <none> v1.37.0 zone-b
lab-worker3 Ready <none> v1.37.0 zone-cThe platform: scripts/bootstrap.sh
A bare cluster can run pods, but production clusters always add a few platform components. The script installs them with pinned versions, then the app:
./scripts/bootstrap.sh
curl http://localhost:8180/api/whoami
{"pod": "web-5c6cf9586b-l5q7x", "node": "lab-worker2", "version": "v1"}Why not ingress-nginx? It was the most common ingress controller for years, and it was retired in March 2026: no more releases or security fixes. The Gateway API is its successor in Kubernetes itself, and NGINX Gateway Fabric is one implementation of it (others: Envoy Gateway, Istio, Traefik, Cilium).
The lab runner
./scripts/lab.sh rollouts.pylab.sh writes an admin kubeconfig that points at the API server by its
container name (kind get kubeconfig --internal), builds the labs image
(Python, the Kubernetes client, kubectl), and runs it on kind's Docker
network with the Docker socket mounted, so node_failure.py can stop a node.
The labs container is outside the pod network: pod IPs (10.244.x.x)
only route between nodes. The first version of probes.py tried to call a
pod directly and timed out. Labs now reach pods through a toolbox
Deployment in a labs namespace, the way you'd debug from inside a real
cluster.
Lab
- Create the minimal cluster, then
docker ps: what is a "node"? - Create the lab cluster and run
bootstrap.sh. Runkubectl get pods -A -o wideand sort the pods into "control plane", "platform" and "app". docker exec -it lab-worker crictl ps: the containers on one node, as its kubelet sees them.