☸️ Kubernetes: Fix a Mutating Webhook Timing Out Under Node Pressure
A mutating admission webhook with failurePolicy: Fail has to respond to every pod creation request across the cluster, including the ones needed to reschedule pods that just got evicted during a node memory or CPU pressure event — if the webhook’s own pod can’t stay scheduled or responsive during that same pressure, its timeouts start blocking all new pod admission, which includes the exact pods the cluster needs to create to recover, turning a single-node incident into a cluster-wide scheduling outage.
🔎 The Problem
# webhook config - this is the part that turns an outage into a worse one
webhooks:
- name: inject-sidecar.example.com
failurePolicy: Fail # blocks ALL pod admission if unreachable
timeoutSeconds: 10 # long enough to stall every other pod create
# webhook deployment: replicas: 1, no priorityClassName set
# -> first thing evicted under node pressure, and single point of failure
✅ Fix: Make the Webhook Fail Safe and Survive the Pressure It Guards Against
- Set
failurePolicy: Ignorefor anything non-critical, so a temporarily unreachable webhook doesn’t block scheduling exactly when the cluster needs to reschedule pods the most. - Give the webhook’s own deployment a
priorityClassNamehigh enough that it isn’t the first thing evicted under pressure, and a low enoughtimeoutSecondsthat a slow response fails fast instead of stalling every other pod admission. - Run at least two replicas across separate nodes with proper pod anti-affinity, so losing one node to pressure doesn’t take down the single admission path every other pod creation depends on.
🚨 Why This Is Dangerous
- A
failurePolicy: Failwebhook that can’t respond turns a node-pressure incident into a total scheduling outage, because the exact mechanism the cluster needs to reschedule evicted pods elsewhere is the one blocked by the webhook timing out.
A webhook that fails closed is only as safe as its own ability to stay up during the exact kind of incident it was written to handle.




