Companion runbook · not graded · 6 labs parallel it
Run the incident labs on a real cluster
The parts a browser cannot give you: a scheduler, a saturating database, and a pager.
The six Production On-Call labs grade the decisions - the manifest, the rollout, the runbook you write. They cannot pull an image or saturate a database, because the sandbox has no scheduler. This runbook takes the same scenario to a cluster you own: Bank of Anthos, a Locust load generator, and Prometheus + Grafana that actually scrape the application.
Read this first
A companion runbook, not a graded lab. Every command follows the upstream project's documented path, but the academy has not executed this end to end; treat it as a checklist, verify each step, and keep the labs as the source of truth for what is measured.
Before you start
- A machine or cloud account able to give the cluster 4 vCPU and 8 GB of RAM. The platform is six services, two PostgreSQL instances and a Locust pod.
- kubectl, helm and git on your PATH, and a container runtime for the local options.
- A namespace habit: application workloads in bank-prod, monitoring in monitoring, so a chart upgrade cannot touch a ledger.
- Roughly two hours for the first pass, most of it waiting for images.
The runbook
1. A cluster you can delete
Pick the cheapest thing that satisfies the resource floor. A local cluster is free and disposable; EKS is realistic and bills by the hour whether you are looking at it or not.
$ minikube start --cpus 4 --memory 8192 --kubernetes-version v1.30.0$ kubectl get nodes -o wide
Look for One node, Ready, with at least 4 allocatable CPUs. If the node reports fewer, the platform will schedule but the database will be starved and every later measurement is noise.
Goes wrong here kind works too, but it has no addons command, so metrics-server is a manual apply. Do not use a single-CPU cluster and then conclude the labs' autoscaling lesson is wrong.
2. Install metrics-server before any autoscaler
A HorizontalPodAutoscaler reads CPU from the metrics API. Without it every HPA reports <unknown> and never scales - which looks identical to a broken autoscaler, and is the first false conclusion in this scenario.
$ minikube addons enable metrics-server$ kubectl top nodes$ kubectl top pods -A
Look for kubectl top returns numbers rather than 'error: Metrics API not available'. Only then is an HPA percentage meaningful.
Goes wrong here On a cloud cluster, apply the components manifest instead and give it a minute; the API server takes a scrape interval before it has anything to report.
3. Deploy Bank of Anthos
Google's reference microservices application: six services, two PostgreSQL StatefulSets and a Locust load generator. Apache-2.0, and named as Google's wherever it appears.
$ git clone https://github.com/GoogleCloudPlatform/bank-of-anthos.git$ cd bank-of-anthos$ kubectl create namespace bank-prod$ kubectl apply -f extras/jwt/jwt-secret.yaml -n bank-prod$ kubectl apply -f kubernetes-manifests -n bank-prod$ kubectl get pods -n bank-prod -w
Look for Every pod Running, and both databases Ready. The load generator starts on its own and will begin putting traffic through the frontend.
Goes wrong here The JWT secret must land in the same namespace as the services, or the auth and ledger pods crash-loop on startup with a key error rather than a clear message.
4. Drive load, and watch throughput rather than CPU
The load generator is Locust. Ramping users is how you create the incident the labs describe - and the number that matters is requests per second, not pods.
$ kubectl port-forward svc/loadgenerator 8089:8089 -n bank-prod$ # open http://localhost:8089 and ramp to 250 users$ kubectl get pods -n bank-prod -w
Look for Throughput rising, then flattening while you add users. A flat RPS with rising latency is the signature of a bottleneck behind the tier you are scaling.
Goes wrong here On four CPUs the database will saturate before the frontend does. That is the lesson, not a failure: more callers do not create database connections you do not have.
5. Monitoring that actually scrapes the application
kube-prometheus-stack gives you Prometheus, Grafana and Alertmanager. It does not automatically scrape a workload it has never heard of, so cluster metrics appear and application latency does not.
$ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts$ helm repo update$ helm install monitoring prometheus-community/kube-prometheus-stack -n monitoring --create-namespace$ kubectl port-forward svc/monitoring-grafana 3000:80 -n monitoring$ # Prometheus UI, Status -> Targets: find the application targets
Look for The application's targets exist and are UP, and a query such as rate(http_requests_total[5m]) returns series. Cluster-only metrics mean nothing is scraping the app.
Goes wrong here The upstream manifests ship no ServiceMonitor (it is a Prometheus Operator CRD, not a core object). Add a ServiceMonitor or pod scrape annotations - this is the gap the sandbox cannot show you, and the reason a dashboard can look healthy during an outage.
6. Make a rollout actually zero-downtime
A Deployment's default rolling update allows 25% of pods to be unavailable, so a 'successful' rollout serves errors for its duration. Zero downtime is a configuration, not a default.
$ kubectl patch deployment frontend -n bank-prod --type merge -p '{"spec":{"strategy":{"rollingUpdate":{"maxUnavailable":0}}}}'$ kubectl rollout status deployment/frontend -n bank-prod
Look for maxUnavailable 0 and a readiness probe present, then a rollout that keeps serving. Without the probe, Kubernetes has no way to know a new pod is not ready yet.
7. Autoscale a tier that can actually help
Give the workload a CPU request first, then an HPA. A percentage is a fraction of the request: no request, no scaling.
$ kubectl set resources deployment frontend -n bank-prod --requests=cpu=200m$ kubectl autoscale deployment frontend -n bank-prod --min=2 --max=6 --cpu-percent=60$ kubectl get hpa -n bank-prod -w
Look for TARGETS showing a real percentage, then replicas climbing. If latency does not fall as replicas rise, the bottleneck is behind this tier - go back to step 4 and read the database.
8. The outage drill
Same incident as the graded lab, with real consequences: the ledger database disappears and the application fails.
$ kubectl scale statefulset/ledger-db --replicas=0 -n bank-prod$ kubectl logs -n bank-prod -l app=ledgerwriter --tail=20$ kubectl scale statefulset/ledger-db --replicas=1 -n bank-prod
Look for Connection errors at the caller, a dead database, then recovery. Capture the log line and the timestamp before you restore anything - that is the evidence your post-mortem needs.
Goes wrong here Do this on a cluster you are willing to break. On EKS, a StatefulSet scaled to zero keeps its volume; deleting the namespace does not.
9. A bad release, and the difference between undo and revert
Roll back in the cluster, then fix the source of truth, or the next deploy puts the broken tag back.
$ kubectl set image deployment/transactionhistory server=invalid-image:v99 -n bank-prod$ kubectl get pods -n bank-prod$ kubectl describe pod -n bank-prod -l app=transactionhistory | tail -20$ kubectl rollout history deployment/transactionhistory -n bank-prod$ kubectl rollout undo deployment/transactionhistory -n bank-prod
Look for ImagePullBackOff on the new pods while the old ones keep serving, then a rollback that restores the previous revision. The repository is still wrong until you revert the commit.
10. Tear it down
The bill is part of the operational lesson. An EKS control plane bills by the hour whether or not anything is running in it.
$ minikube delete$ # or, on EKS: eksctl delete cluster --name <name>$ # verify nothing is left billing: check the console, do not trust the terminal
Look for No cluster, no load balancer, no unattached volumes. A forgotten load balancer is the most common surprise on a cloud bill.
What it costs
minikube or kind
Free. Your laptop's CPU and RAM for the duration.
The intended path for the labs. 4 vCPU and 8 GB is the floor, not a suggestion.
Amazon EKS
A per-hour control-plane charge plus the worker nodes you attach.
Roughly the cost of a small always-on server while it exists. Check current pricing before you start, and set a reminder to destroy it.
GitHub Codespaces
Free minutes on some plans, then an hourly rate for a 4-core machine.
Convenient, but a nested cluster inside a codespace is slow enough to distort the latency numbers you are trying to read.
Prices are not quoted on purpose: a provider changes them more often than this page changes. Check the current rate before you start, and set the teardown reminder at the same time.
What this page cannot give you
- Nothing on this page is graded. The six labs are where a check runs.
- The academy has not executed this runbook end to end; it follows upstream documentation, and upstream changes.
- Latency numbers from a laptop are not production numbers. The shape of the curve is the lesson, not the milliseconds.
- Bank of Anthos is Google's project under Apache-2.0. It is not OphirCloud's application, and this page does not pretend otherwise.
The decisions it assumes you can make
Each stage above has a graded counterpart. If the runbook goes wrong in a way you cannot diagnose, the lab is where the state is checked for you.
- 01On-call: bring the payments platform upIntermediate · 30 min · 4 activities
- 02On-call: ship the image through a GitOps pipelineAdvanced · 30 min · 4 activities
- 03On-call: autoscale under a traffic surgeIntermediate · 25 min · 3 activities
- 04On-call: autoscaling did not fix the latencyAdvanced · 30 min · 4 activities
- 05On-call: the ledger database is goneAdvanced · 35 min · 4 activities
- 06On-call: roll back a bad releaseAdvanced · 25 min · 3 activities