How to fix failed calling webhook in Kubernetes
Admission webhooks timeout because the webhook handler is slow, unavailable, or the cluster cannot reach it. Webhooks block pod creation/updates, causing deployments to fail. Fix by optimizing webhook performance, adding replicas behind a service, or adjusting timeout values.
Quick fix
Fixes failed calling webhook
kubectl get pods -n <webhook-namespace> -o wide
kubectl describe pod <webhook-pod> -n <webhook-namespace>
kubectl logs <webhook-pod> -n <webhook-namespace>- Check webhook pod status
- Verify webhook service and endpoints
- Test webhook connectivity
- Review webhook configuration
kubectl get pods -n <webhook-namespace> -o widekubectl describe pod <webhook-pod> -n <webhook-namespace>kubectl logs <webhook-pod> -n <webhook-namespace>failed calling webhook
What this error means
Admission webhooks intercept API server requests (pod creation, updates, deletions) and must respond within timeoutSeconds (default 10s). If webhook times out, the API request fails per failurePolicy (Fail=reject, Ignore=allow). Timeouts indicate slow handler, network issues, or webhook unavailability.
Typical symptoms
- Pod creation/updates timeout or hang
- Error: "failed calling webhook {name}: the server is currently unable to handle the request"
- Deployments stuck rolling out
- kubectl apply commands hang indefinitely
- Webhook events show timeout errors
- Intermittent: webhook works sometimes, fails other times
- Failures correlate with cluster load spikes
Common causes
- Webhook pod not running or not ready (CrashLoopBackOff)
- Webhook handler slow (expensive computation, external API calls)
- Network latency between API server and webhook
- Single webhook replica overloaded (no load balancing)
- Webhook DNS not resolving (.svc.cluster.local domain)
- TLS certificate issues preventing webhook connection
- Resource starvation (webhook pod under CPU/memory pressure)
How to fix "failed calling webhook"
Verify webhook is running:
kubectl get pods -n <webhook-namespace> -o wide
kubectl describe pod <webhook-pod> -n <webhook-namespace>
kubectl logs <webhook-pod> -n <webhook-namespace>Pod should be Running and Ready. Check logs for errors.
Check service configuration:
kubectl get svc -n <webhook-namespace>
kubectl get endpoints <webhook-service> -n <webhook-namespace>
kubectl describe svc <webhook-service> -n <webhook-namespace>Service should have endpoints pointing to ready pods.
Test TLS connection to webhook:
kubectl port-forward -n <namespace> svc/<webhook-service> 8443:8443
# In another terminal
curl -k https://localhost:8443/validateIf connection fails or times out, webhook is unreachable.
Check timeout and failure policy:
kubectl get validatingwebhookconfigurations
kubectl get mutatingwebhookconfigurations
kubectl describe validatingwebhookconfig <name> | grep -A10 timeoutSecondsDefault timeout is 10s (1-30s range). Failur policy: Fail=reject, Ignore=allow on timeout.
Add load balancing:
kubectl scale deployment -n <namespace> <webhook> --replicas=3Ensure multiple replicas are running and ready. Webhook service will load-balance across them.
Reduce latency in webhook code:
- Remove external API calls or cache responses
- Optimize policy evaluation logic
- Profile webhook for bottlenecks
- Add connection pooling
- Reduce webhook scope via objectSelector/namespaceSelector
Example: validate only specific namespaces or resource types.
Increase timeoutSeconds (use cautiously):
kubectl patch validatingwebhookconfig <name> --type merge \
-p '{"webhooks":[{"name":"<webhook>","timeoutSeconds":15}]}'Max 30s. Higher timeouts may mask performance issues.
Advanced notes
Webhook timeouts block critical cluster operations; failures cascade. Use failurePolicy: Ignore only for non-critical webhooks (masks issues). Monitor webhook latency and set alerts if timeout rate >1%. Exclude webhook system namespaces from webhook rules to prevent recursion. Use sideEffects: None to ensure dry-run safety.
Frequently asked questions
- What does "failed calling webhook" mean?
- Admission webhooks intercept API server requests (pod creation, updates, deletions) and must respond within timeoutSeconds (default 10s). If webhook times out, the API request fails per failurePolicy (Fail=reject, Ignore=allow). Timeouts indicate slow handler, network issues, or webhook unavailability.
- How do I fix "failed calling webhook"?
- Admission webhooks timeout because the webhook handler is slow, unavailable, or the cluster cannot reach it. Webhooks block pod creation/updates, causing deployments to fail. Fix by optimizing webhook performance, adding replicas behind a service, or adjusting timeout values.
- What causes "failed calling webhook"?
- Webhook pod not running or not ready (CrashLoopBackOff) Webhook handler slow (expensive computation, external API calls) Network latency between API server and webhook
- Is the "failed calling webhook" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- ๐Kubernetes Official Documentation
- ๐Kubernetes Docs: extensible admission controllers(Official Docs)
- ๐Kubernetes Docs: admission webhooks good practices(Official Docs)
- ๐
- ๐