Stage 4, Part 7 of 9, Workloads & Lifecycle Deep Dive

Text

PART 7: INCIDENT MANAGEMENT

35. Workload Incident Post-Mortem Template

text
INCIDENT: Deployment Rollout Failed - All Pods CrashLooping
DATE: 2024-01-15
DURATION: 15 minutes
SEVERITY: SEV-1
IMPACT: 100% of web service down. All users unable to access.

TIMELINE:
  14:00 - Deployment web:v2.0.0 rolled out
  14:01 - Alert: Pods in CrashLoopBackOff
  14:02 - On-call engineer acknowledged
  14:03 - Identified missing ConfigMap "web-config-v2"
  14:05 - Rolled back deployment
  14:07 - Pods recovering
  14:15 - Full service restored

ROOT CAUSE:
  Deployment referenced a new ConfigMap "web-config-v2" that was
  never created. All pods failed to start.

LESSONS LEARNED:
  1. ConfigMaps should be in the same Helm chart as Deployment
  2. Readiness gates should block bad rollouts
  3. CI should validate references

ACTION ITEMS:
  [ ] Add CI validation for resource references (Owner: Platform, Due: 2024-01-20)
  [ ] Configure deployment gates (Owner: SRE, Due: 2024-01-22)
  [ ] Test rollback procedure (Owner: Team, Due: 2024-01-25)

36. On-Call Runbook: Workload Failures

text
SYMPTOM: Workload not performing as expected.

STEP 1: Identify the workload
  $ kubectl get deployments,statefulsets,daemonsets,jobs,cronjobs -A

STEP 2: Check Pod status
  $ kubectl get pods -l app=<name>
  $ kubectl describe deployment <name>

STEP 3: Check for failures
  $ kubectl describe pod <pod>
  # Look at Events

STEP 4: Categorize

  CrashLoopBackOff → check logs, env vars, ConfigMaps
  Pending → check nodes, resources, taints
  OOMKilled → check limits, memory usage
  NotReady → check readiness probe
  Terminating forever → check preStop, SIGTERM handling

STEP 5: Apply fix
  # Rollback if bad deploy
  $ kubectl rollout undo deployment/<name>

  # Fix config
  $ kubectl edit configmap <name>

  # Scale up if overwhelmed
  $ kubectl scale deployment/<name> --replicas=N

STEP 6: Verify
  $ kubectl rollout status deployment/<name>
  $ kubectl get pods -l app=<name>

STEP 7: Document

37. Escalation Matrix

SeverityImpactResponse TimeEscalation
SEV-1All replicas down / service unavailable5 minOn-call + Platform + Management
SEV-2Degraded / partial outage15 minOn-call + Platform
SEV-3Single Pod issue1 hourOn-call
SEV-4Configuration warning4 hoursTicket

1:1 copy of the class Google Doc, code in code blocks.