Stage 1, Part 3 of 9 · p. 3, Kubernetes Fundamentals (Day 0/1)

PART 3: PRODUCTION FAILURE MODES

15. Top 10 Kubernetes Failures

#FailureSymptomRoot CauseFix
1CrashLoopBackOffPod keeps restartingApp crashes on startkubectl logs, fix app
2ImagePullBackOffCan't pull imageWrong tag, auth, networkCheck image, imagePullSecrets
3OOMKilledExit code 137Memory limit exceededIncrease limit, fix leak
4Pending podPod never schedulesNo nodes with resourcesCheck events, add capacity
5Service has no endpointsCan't reach ServiceWrong labels/selectorFix labels
6CreateContainerConfigErrorContainer fails to startMissing ConfigMap/SecretCreate the missing resource
7Readiness probe failurePod not ReadyApp not respondingFix probe or app
8PVC pendingVolume never bindsNo matching PV/StorageClassCheck StorageClass
9Ingress not routing404/502Wrong service/portCheck Ingress config
10Node NotReadyNode unavailableKubelet down, disk fullSSH, check kubelet

16. Kubernetes Debugging Runbook

"Pod Won't Start" — Step-by-Step

text
STEP 1: Check Pod status
  $ kubectl get pods
  $ kubectl get pods -o wide

STEP 2: Describe the Pod (best source of truth)
  $ kubectl describe pod <pod>
  # Look at Events section at the bottom

STEP 3: Check logs
  $ kubectl logs <pod>
  $ kubectl logs <pod> --previous    # Previous instance if crashed

STEP 4: For CrashLoopBackOff
  # Check the app's exit code
  $ kubectl get pod <pod> -o jsonpath='{.status.containerStatuses[0].lastState}'
  # Review logs
  $ kubectl logs <pod> --previous

STEP 5: For ImagePullBackOff
  $ kubectl describe pod <pod> | grep -A5 Events
  # Common causes:
  # - Wrong image name/tag
  # - No imagePullSecrets
  # - Registry unreachable

STEP 6: For Pending
  $ kubectl describe pod <pod> | grep -A10 Events
  # Common causes:
  # - Insufficient resources
  # - Node selector/affinity mismatch
  # - Taints without tolerations
  # - PVC not bound

STEP 7: For CreateContainerConfigError
  $ kubectl describe pod <pod>
  # Usually missing ConfigMap or Secret
  $ kubectl get configmap <name>
  $ kubectl get secret <name>

STEP 8: Exec into the Pod (if running)
  $ kubectl exec -it <pod> -- sh
  $ kubectl exec -it <pod> -- /bin/bash

STEP 9: Use kubectl debug for ephemeral containers
  $ kubectl debug -it <pod> --image=busybox --target=<container>

STEP 10: Check events cluster-wide
  $ kubectl get events --sort-by=.metadata.creationTimestamp
  $ kubectl get events --field-selector involvedObject.name=<pod>

Quick Diagnostic Table

StatusLikely CauseCheck
CrashLoopBackOffApp errorkubectl logs --previous
ImagePullBackOffImage/authkubectl describe pod
PendingResources/affinitykubectl describe pod
OOMKilledMemory limitIncrease limit, check leaks
Readiness probe failedApp slowTune probe
Service no endpointsLabelskubectl get endpoints

17. Blast Radius Analysis

What Happens When Kubernetes Fails?

ComponentImpactSeverity
API server downCan't manage cluster; running Pods continueSEV-1
etcd downControl plane can't functionSEV-1
Scheduler downNew Pods stay PendingSEV-2
Controller Manager downNo reconciliationSEV-2
Node NotReadyPods evicted after timeoutSEV-1
CNI failurePods lose networkSEV-1
DNS failureService discovery breaksSEV-1
Ingress downExternal access failsSEV-1

Mitigation Strategies

StrategyImplementation
Multi-master control plane3+ masters, etcd quorum
Multiple replicasAt least 2-3 per workload
PodDisruptionBudgetsProtect during disruptions
Anti-affinitySpread replicas across nodes
Backup etcdRegular snapshots
GitOpsDeclarative, versioned
MonitoringPrometheus, alerts

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