Labs
One playbook per phase. Every YAML file is complete and copy-pasteable, every step shows the expected output, and every lab ends with a verify block. Where the syllabus asks you to write something by hand, the solution is in a collapsible block - try first, then peek.
Ground rules
- Type the kubectl commands yourself. Copy-paste YAML, but type commands - that's where muscle memory comes from.
- Read every error. When output doesn't match the expected output shown, stop and figure out why before continuing. That debugging is the actual learning.
- Do the labs in order. Lab 4 assumes the cluster from Lab 1, Lab 6 reuses manifests from Lab 2.
The demo stack
All labs use the same small set of public, multi-arch images (they work on Apple Silicon):
| Image | Role in the labs |
|---|---|
traefik/whoami | The main app. Tiny HTTP server that echoes its hostname - perfect for seeing load balancing and rolling updates. Tags v1.10 and v1.11 give us real version upgrades. |
postgres:16-alpine | The stateful workload for config, secrets, and persistent volumes. |
adminer | A web UI for Postgres - our "app that depends on a database" for probe exercises. |
nginx | Static frontend for the ingress lab. |
curlimages/curl | In-cluster test client. |
busybox:1.36 | CronJob payloads. |
polinux/stress | Deliberately eats memory so we can trigger OOMKilled on purpose. |
Prerequisites
bash
brew install kind kubectl k9s helm
docker --version # any recent version, must be runningWorkspace
Keep lab files in a directory per lab:
bash
mkdir -p ~/project/k8dev-labs/{lab-1,lab-2,lab-3,lab-4,lab-5,lab-6}
cd ~/project/k8dev-labsThe labs
| Lab | Pairs with | What you build |
|---|---|---|
| Lab 1 | Phase 1 | An ingress-ready kind cluster + kubectl drills |
| Lab 2 | Phase 2 | whoami: Deployment, Service, rolling update, rollback |
| Lab 3 | Phase 3 | Postgres + Adminer with ConfigMap, Secret, PVC, probes |
| Lab 4 | Phase 4 | Two services behind one Ingress on a real hostname |
| Lab 5 | Phase 5 | Break-and-fix drills, CronJob, autoscaling |
| Lab 6 | Phase 6 | Helm install of podinfo + Kustomize dev/prod overlays |