Stage 4, Part 3 of 9 · p. 31, Workloads & Lifecycle Deep Dive

PART 3: PRODUCTION FAILURE MODES

17. Top 10 Workload Failures

#FailureSymptomRoot CauseFix
1CrashLoopBackOffPod keeps restartingApp crashesCheck logs, fix app
2ImagePullBackOffCan't pull imageBad tag, authFix image or secrets
3OOMKilledExit 137Memory limit exceededIncrease limit, fix leak
4Readiness probe failsPod never ReadyProbe or app issueFix probe or app
5PDB blocking drainCan't drain nodePDB too strictAdjust PDB
6StatefulSet stuckPods won't start in orderPod 0 unhealthyFix Pod 0
7Job never completesJob stuck runningNon-idempotent job, hook failureFix job logic
8PreStop hangsPod takes forever to terminatePreStop script bugFix preStop
9Slow rolloutUpdate takes hoursmaxUnavailable too low, probes too strictTune rollout
10Native sidecar incompatibilityPod fails to startK8s < 1.29Upgrade K8s or use traditional sidecar

18. Workload Debugging Runbook

"Workload is Broken" — Step-by-Step

text
STEP 1: Check the workload status
  $ kubectl get deployment/<name>
  $ kubectl get statefulset/<name>
  $ kubectl get pods -l app=<name>

STEP 2: Check the Pod
  $ kubectl describe pod <pod>
  # Look at Status, Events, Container States

STEP 3: Check logs
  $ kubectl logs <pod>
  $ kubectl logs <pod> --previous          # If crashed
  $ kubectl logs <pod> -c <container>      # Multi-container

STEP 4: Categorize the issue

  Pending → Scheduling issue
    - Check node resources
    - Check taints/tolerations
    - Check PVC status
    - Check PDB

  ImagePullBackOff → Image issue
    - Check image name/tag
    - Check imagePullSecrets
    - Check registry connectivity

  CrashLoopBackOff → App issue
    - Check logs --previous
    - Check exit code
    - Check env vars, ConfigMaps, Secrets

  Running but not Ready → Probe issue
    - Check probe endpoint
    - Check describe pod for probe failures
    - Test probe manually

  Terminating (stuck) → Termination issue
    - Check preStop hook
    - Check terminationGracePeriodSeconds
    - Check app SIGTERM handling

STEP 5: Check resource limits
  $ kubectl top pod <pod>
  $ kubectl describe pod <pod> | grep -A5 Resources

STEP 6: Check PDB
  $ kubectl get pdb
  $ kubectl describe pdb <name>

STEP 7: Check StatefulSet-specific issues
  $ kubectl get pvc -l app=<name>
  $ kubectl get pv

STEP 8: Deep debugging
  $ kubectl debug -it <pod> --image=busybox --target=<container>

STEP 9: Escalate

19. Blast Radius Analysis

What Happens When Workloads Fail?

ComponentImpactSeverity
All replicas crashService downSEV-1
One replica crashDegraded capacitySEV-2
StatefulSet Pod 0 downCluster unavailableSEV-1
PDB blocks drainCan't upgrade clusterSEV-2
Job failsBatch incompleteSEV-3
CronJob failsMissed scheduleSEV-3
Probe misconfigurationTraffic to bad podsSEV-2

Mitigation Strategies

StrategyImplementation
Multiple replicas3+ for production
Pod anti-affinitySpread across nodes/AZs
Readiness probesNo traffic to bad pods
PodDisruptionBudgetsProtect during disruptions
Graceful shutdownNo dropped requests
Resource limitsPredictable behavior

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