Core Track Guardrails-first chapter in core learning path.

Estimated Time

  • Reading: 20-25 min
  • Lab: 45-60 min
  • Quiz: 10-15 min

Prerequisites

Source Code References

  • develop/ Members
  • develop/ Members

Sign in to view source code.

What You Will Produce

A reproducible lab result plus quiz verification and incident-safe operating evidence.

Drain Day Scenario

Run one controlled node drain rehearsal and compare outcomes:

  1. Healthy HPA + PDB: The drain proceeds smoothly with bounded disruption; HPA adds more replicas if necessary.
  2. Restrictive PDB: The drain blocks (expected protective behavior) because the service is at its minimum replica count.
  3. Low Replica Baseline: Higher user-facing risk and slower recovery during the drain.

Objective: Confirm expected behavior before a real, high-stakes maintenance event.

Core Exercises (Required)

  1. Verify HPA: Use kubectl get hpa -n develop to see the scaling status and utilization targets.
  2. Check PDB: Use kubectl get pdb -n develop to see the current allowed disruptions.
  3. Simulate Load: Use a simple ab or hey script to generate traffic and observe the HPA adding replicas.
  4. Debug a Blocked Drain: Set minAvailable in your PDB equal to your current replica count. Try to drain the node and document how Kubernetes prevents the disruption.

Challenge Exercise (Optional)

Drain During Rolling Update: Simulate a node drain during an active rolling update and verify that PDB constraints prevent service disruption. Document the exact sequence of pod evictions and replacements.

Done When

You have completed this chapter when:

  • You can verify HPA targets, current bounds, and current scaling state.
  • You can verify PDB allowed disruptions before a node drain.
  • You can explain the interaction between HPA, PDB, rollout, and drain.
  • You understand why minReplicas: 2 is a reliability requirement for production.

Knowledge Check

Before finishing this chapter, complete the Quiz to verify your understanding of the guardrail principles.