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.

Guardrails That Stop It

  • Multi-Replica Baseline: staging and production start with a minimum of 2 replicas for all critical services.
  • Scaling Bounds: Every service must define minReplicas and maxReplicas and target resource utilization (CPU/Memory).
  • Disruption Budgeting: Every service must have a Pod Disruption Budget (PDB) to prevent unsafe disruption during maintenance.
  • Pre-Drain Verification: Never execute a node drain or rollout without first checking the PDB and HPA state.

Expected Baseline

  • HPA (autoscaling/v2): Configured for both backend and frontend in all environments.
  • PDB (policy/v1): Configured to allow exactly 1 disruption at a time for multi-replica services.

Backend HPA and PDB layout

Show the backend availability layout
  • flux/apps/backend/develop/hpa.yaml
  • flux/apps/backend/develop/image-automation.yaml
  • flux/apps/backend/develop/image-policy.yaml
  • flux/apps/backend/develop/kustomization.yaml
  • flux/apps/backend/develop/patches/feature-flags.yaml
  • flux/apps/backend/develop/pdb.yaml

Safe Workflow (Step-by-Step)

  1. Preflight Check: Verify the current HPA status and its defined bounds.
  2. Confirm PDB Allowance: Ensure ALLOWED DISRUPTIONS is greater than 0.
  3. Trigger Disruption: Perform the maintenance action (e.g., node drain).
  4. Observe Scaling: Watch the HPA react if load shifts to the remaining pods.
  5. Final Verification: Confirm the workload remains available and returns to its desired replica count after the action is complete.

Frontend HPA and PDB layout

Show the frontend availability layout
  • flux/apps/frontend/overlays/develop/hpa.yaml
  • flux/apps/frontend/overlays/develop/image-automation.yaml
  • flux/apps/frontend/overlays/develop/image-policy.yaml
  • flux/apps/frontend/overlays/develop/kustomization.yaml
  • flux/apps/frontend/overlays/develop/namespace.yaml
  • flux/apps/frontend/overlays/develop/patches/deployment.yaml
  • flux/apps/frontend/overlays/develop/patches/ingress.yaml
  • flux/apps/frontend/overlays/develop/pdb.yaml

This builds on: Resource management (Chapter 08) — HPA and PDB build on resource contracts. This enables: Observability (Chapter 10) — availability signals feed the monitoring stack.