Lab & Completion
What You Will Produce
On your own kind cluster, the platform’s apps read as numbers: what each pod asks for and is allowed, its QoS class, what it really uses, and how much of the develop budget it takes - and the worst case check-app-resources.sh checks before a merge. Then, in lab: a Guaranteed and a Burstable container killed at the same memory limit and kept, so OOMKilled can be read; a container throttled for seconds without a single event; a Deployment the quota stops at two pods of three; and a pod the LimitRange refuses at once. The lab ends with lab empty; the apps in develop are never changed.
Before You Start
The baseline from Chapter 00 must be clean:
flux --context kind-sre-control-plane get kustomizations -A # every row READY=True and SUSPENDED=False
kubectl --context kind-sre-control-plane get pods -A --no-headers | grep -vE 'Running|Completed' # prints nothing
make smoke-test # 9/9
This chapter also needs labs/resource-management/ in your clone: if it is missing, your fork must first catch up with the course repository: on GitHub, open your fork and click Sync fork → Update branch. Then git switch main && git pull - it fetches from your clone’s remote (your fork) and merges the changes into your local main; it does not sync your fork with the course repository, which is why the Sync fork step comes first.
The Lab in Three Parts
- A. Verify - the apps’ requests, limits and classes; what they use; the namespace’s quota and LimitRange; the worst case before a merge.
- B. Break & Fix - OOMKilled read from the container’s status, for two classes; throttling seen only in a counter; a quota and a LimitRange refusing pods.
- C. Rollback & Cleanup - the lab’s pods and Deployment deleted,
labempty, the baseline proven.
Done When
- the three pods in
developshowedBurstable, each with requests lower than its limits (A2), andkubectl toptheir working set (A3) - the quota’s
UsedandHardand the LimitRange’s min/max were read (A4), andcheck-app-resources.shprinted the worst case andOK(A5) -
hog-guaranteedprintedGuaranteed OOMKilled 137andhog-burstableBurstable OOMKilled 137(B1-B2) -
spinnerprintednr_throttledclose tonr_periodsand endedCompleted 0(B3) -
greedystayed at2/3, withexceeded quota: compute-quotain its ReplicaSet’s events (B4) -
50-over-limitrange.yamlwas refused withmaximum cpu usage per Container is 500m(B5) - at the end
kubectl --context kind-sre-control-plane -n lab get podsprintsNo resources foundand the baseline is clean (C1-C2)
Knowledge Check
Before finishing this chapter, complete the Quiz.