5.3.9 · D3MLOps & Deployment

Worked examples — Kubernetes for ML workloads

2,950 words13 min readBack to topic

Before any formula: read every symbol out loud in plain words so nothing enters undefined.


The scenario matrix

Every cell below is a distinct shape of problem. The worked examples are tagged with the cell(s) they cover.

# Cell (case class) What makes it tricky Example
A Exact fit — request divides capacity no waste; floor is exact Ex 1
B Leftover / stranded — request does not divide capacity floor drops a fraction → wasted resource Ex 2
C Two constraints at once — RAM and GPU both limit the tighter one wins Ex 3
D HPA scale-up — metric above target ratio , ceil rounds up Ex 4
E HPA scale-down — metric below target ratio , replicas shrink Ex 5
F Degenerate: zero load formula wants 0 replicas → floor/min-replica clamp Ex 6
G Dead-band / no-op — ratio inside tolerance correct action is do nothing Ex 7
H Limiting value: hits cluster ceiling — desired > max that fits HPA blocked by capacity, not maths Ex 8
I Word problem — real cost/traffic story end-to-end translate English → symbols Ex 9
J Exam twist — the "obvious" answer is the trap crash-loop / QoS misconception Ex 10

Group 1 — Packing Pods onto nodes (cells A, B, C)


Group 2 — Autoscaling with the HPA formula (cells D, E, F, G, H)

Recall the engine, and re-earn every symbol:


Group 3 — Word problem & exam twist (cells I, J)


Active recall

Recall Test the matrix (hide answers)
  • Node 20 GB, Pod 6 GB — Pods and stranded? ::: , stranded GB.
  • Two limits RAM→7, GPU→4, which wins? ::: ; the scarcer resource.
  • , , ? ::: .
  • — real answer? ::: minReplicas, not 0 (stock HPA can't scale to zero).
  • Ratio 0.95 with 10% tolerance? ::: inside dead-band → do nothing.
  • HPA wants 15 but only 8 GPUs fit? ::: 8 run, 7 Pending; add nodes.
  • Fix for a crash-looping Pod? ::: probes / image, NOT more replicas.

Connections