Stage 7, Part 7 of 9 · p. 62, Kubernetes Networking Deep Dive

PART 7: INCIDENT MANAGEMENT

35. Networking Incident Post-Mortem Template

text
INCIDENT: CoreDNS Failure - Cluster-Wide Service Discovery Outage
DATE: 2024-01-15
DURATION: 47 minutes
SEVERITY: SEV-1
IMPACT: All services lost DNS resolution. All API calls failed.

TIMELINE:
  14:00 - Monitoring alert: CoreDNS QPS dropped to zero
  14:03 - On-call acknowledged
  14:05 - Identified CoreDNS pods OOMKilled
  14:08 - CoreDNS memory limit (170Mi) too low for cluster
  14:12 - Increased memory to 500Mi
  14:15 - CoreDNS pods restarted
  14:20 - DNS resolution restored
  14:47 - Incident closed

ROOT CAUSE:
  CoreDNS memory limit (170Mi) was too low for 5,000 Pods.
  Cache grew beyond limit, OOMKilled, crashlooped.

LESSONS LEARNED:
  1. CoreDNS memory must be sized for peak, not average.
  2. NodeLocal DNSCache would have prevented this.
  3. Alerting must fire on CoreDNS restarts.

ACTION ITEMS:
  [ ] Increase CoreDNS memory to 500Mi (Owner: Platform)
  [ ] Deploy NodeLocal DNSCache (Owner: Platform)
  [ ] Add CoreDNS restart alerting (Owner: SRE)

36. On-Call Runbook: Service Unreachable

text
STEP 1: Check the Service
  $ kubectl get svc <service> -o yaml

STEP 2: Check endpoints
  $ kubectl get endpoints <service>
  $ kubectl get endpointslices -l kubernetes.io/service-name=<service>

STEP 3: Check matching Pods
  $ kubectl get pods -l <selector>
  $ kubectl get pods -l <selector> -o wide

STEP 4: Check Pod readiness
  $ kubectl describe pod <pod> | grep -A3 Readiness

STEP 5: Test DNS
  $ kubectl run test --image=busybox --rm -it --restart=Never -- nslookup <service>

STEP 6: Check NetworkPolicy
  $ kubectl get networkpolicies -A

STEP 7: Check CNI
  $ kubectl get pods -n kube-system -l k8s-app=cilium
  $ kubectl logs -n kube-system -l k8s-app=cilium --tail=50

STEP 8: Check kube-proxy
  $ kubectl logs -n kube-system -l k8s-app=kube-proxy --tail=50

STEP 9: Escalate

37. Escalation Matrix

SeverityImpactResponse TimeEscalation
SEV-1Cluster-wide networking / DNS outage5 minOn-call + Platform + Management
SEV-2Service unreachable / partial outage15 minOn-call + Platform
SEV-3Single service issue1 hourOn-call
SEV-4Configuration warning4 hoursTicket

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