Kubernetes Admission Webhook 超时的定位
创建/更新资源报 failed calling webhook ... context deadline exceeded、connection refused 或 x509 错误,API 请求被拒绝或明显变慢。
kubectl get validatingwebhookconfigurations
kubectl get mutatingwebhookconfigurations
kubectl describe validatingwebhookconfiguration <name>
kubectl get svc,endpoints -n <webhook-ns>
kubectl logs -n <webhook-ns> <pod> --tail=100
failurePolicy: Fail 让 webhook 故障放大为 API 拒绝。caBundle 与 webhook 证书匹配。timeoutSeconds,但先优化 webhook 处理逻辑。failurePolicy 改为 Ignore,随后恢复。k8s 分支的 admission-webhook 页面 — 配置细节合上页面,先回答,再展开对照。
failed calling webhook ... context deadline exceeded 时,常见根因有哪些?caBundle 不匹配会表现成什么?timeoutSeconds 太短;NetworkPolicy/防火墙阻断;以及 failurePolicy: Fail 把故障放大为 API 拒绝。x509 等 TLS 错误;应确认 caBundle 与 webhook 实际证书匹配。failurePolicy 改为 Ignore 或调整超时,但随后必须恢复;长期应恢复工作负载和 Service/Endpoints、修证书、优化处理逻辑,并加副本、PDB 和监控。
小程序版
微信扫码,随时查命令