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, lab empty, the baseline proven.

Open the lab →

Done When

  • the three pods in develop showed Burstable, each with requests lower than its limits (A2), and kubectl top their working set (A3)
  • the quota’s Used and Hard and the LimitRange’s min/max were read (A4), and check-app-resources.sh printed the worst case and OK (A5)
  • hog-guaranteed printed Guaranteed OOMKilled 137 and hog-burstable Burstable OOMKilled 137 (B1-B2)
  • spinner printed nr_throttled close to nr_periods and ended Completed 0 (B3)
  • greedy stayed at 2/3, with exceeded quota: compute-quota in its ReplicaSet’s events (B4)
  • 50-over-limitrange.yaml was refused with maximum cpu usage per Container is 500m (B5)
  • at the end kubectl --context kind-sre-control-plane -n lab get pods prints No resources found and the baseline is clean (C1-C2)

Knowledge Check

Before finishing this chapter, complete the Quiz.