Stage 9, Part 7 of 9 · p. 80, Cluster Extensibility (CRDs, Controllers, Operators)

PART 7: INCIDENT MANAGEMENT

32. Operator Incident Post-Mortem Template

text
INCIDENT: Validating Webhook Outage - Cluster-Wide Deployment Failure
DATE: 2024-01-15
DURATION: 23 minutes
SEVERITY: SEV-1
IMPACT: All Pod creations failed. New deployments stuck.

TIMELINE:
  14:00 - Deployment web:v2.0.0 started
  14:01 - Alert: API server 500 errors
  14:03 - Identified webhook service unavailable
  14:05 - Webhook pods OOMKilled
  14:08 - Increased webhook memory
  14:12 - Webhook pods restarted
  14:15 - API requests resumed
  14:23 - Incident closed

ROOT CAUSE:
  Webhook pod had 128Mi memory limit. High load caused OOM.
  failurePolicy: Fail blocked all matching API requests.

LESSONS LEARNED:
  1. Webhooks need HA and adequate resources.
  2. failurePolicy: Fail can cause cluster-wide outages.
  3. Use ValidatingAdmissionPolicy (CEL) for simple policies.

ACTION ITEMS:
  [ ] Increase webhook resources (Owner: Platform)
  [ ] Migrate simple policies to CEL (Owner: Platform)
  [ ] Add webhook HA (Owner: Platform)

33. On-Call Runbook: Operator Failures

text
STEP 1: Check operator pods
  $ kubectl get pods -n <operator-namespace>

STEP 2: Check operator logs
  $ kubectl logs -n <operator-namespace> <operator-pod> --tail=100

STEP 3: Check CRD
  $ kubectl get crd <crd-name>
  $ kubectl describe crd <crd-name>

STEP 4: Check webhooks
  $ kubectl get validatingwebhookconfigurations
  $ kubectl get mutatingwebhookconfigurations

STEP 5: Check webhook service
  $ kubectl get svc -n <webhook-namespace>
  $ kubectl get endpoints -n <webhook-namespace>

STEP 6: Check RBAC
  $ kubectl auth can-i --list --as=system:serviceaccount:<ns>:<sa>

STEP 7: If webhook blocking
  # Temporarily set failurePolicy to Ignore
  $ kubectl patch validatingwebhookconfiguration <name> --type='json' \
    -p='[{"op":"replace","path":"/webhooks/0/failurePolicy","value":"Ignore"}]'

STEP 8: Escalate

34. Escalation Matrix

SeverityImpactResponse TimeEscalation
SEV-1Webhook blocking all API requests5 minOn-call + Platform + Management
SEV-2Operator crash loop / partial failure15 minOn-call + Platform
SEV-3Single CR stuck1 hourOn-call
SEV-4Configuration warning4 hoursTicket

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