Interview Prep/Real-World Interview/Kubernetes cluster-level

No one can deploy anything; every create or update fails with `failed calling webhook "validate.policy.example.com": Post "https://policy-svc.policy.svc:443/validate?timeout=10s": context deadline exceeded`.

AdvancedTroubleshootingKubernetes cluster-level
Answer

Likely causes → A validating or mutating admission webhook is down (its pods crashed, were evicted, or are blocked by a NetworkPolicy) and is registered with failurePolicy: Fail and a broad scope. The API server must call it for every matching request, so everything is blocked, possibly including the webhook's own pods trying to come back.

Diagnose →

kubectl get validatingwebhookconfigurations,mutatingwebhookconfigurations
kubectl get validatingwebhookconfiguration policy -o jsonpath='{.webhooks[*].failurePolicy} {.webhooks[*].namespaceSelector}'
kubectl -n policy get pods,endpoints

Fix → Restore the webhook service if you can. If not, unblock the cluster by switching it to Ignore or deleting the configuration temporarily:

kubectl patch validatingwebhookconfiguration policy --type=json \
  -p='[{"op":"replace","path":"/webhooks/0/failurePolicy","value":"Ignore"}]'

Put it back once the webhook pods are healthy.

Prevent → Exclude kube-system and the webhook's own namespace with a namespaceSelector, run at least 2–3 webhook replicas with a PDB, keep timeoutSeconds low, and alert on apiserver_admission_webhook_rejection_count and webhook latency.

All Real-World Interview questions Roadmap: Interview readiness

More on Kubernetes cluster-level