Policy webhooks add 2–3 seconds to every pod creation and HPA scale-ups lag
AdvancedTroubleshootingKubernetes admission control and Pod Security
Answer
Likely causes → Image verification hitting remote registries on every admission, expensive Rego/JMESPath over large lists, or too few webhook replicas.
Diagnose →
kubectl get --raw /metrics | grep apiserver_admission_webhook_admission_duration_seconds_bucket | grep -E "kyverno|gatekeeper" | tail
Fix → Enable image verification caching, scope verifyImages to your registries, scale webhooks horizontally, and narrow match to the kinds that need checks.
Prevent → Track webhook p99 latency SLOs and load-test policies before rollout.
More on Kubernetes admission control and Pod Security
`Error from server: admission webhook "validate.kyverno.svc-fail" denied the request: policy Deployment/prod/api for resource violation: require-run-as-nonroot`BeginnerPods do not appear, but `kubectl apply` of the Deployment succeededBeginner`pods "api-7d9" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false, unrestricted capabilities, seccompProfile`BeginnerEnabling `enforce=restricted` on a namespace did not evict the existing non-compliant podsBeginner`Error from server (InternalError): Internal error occurred: failed calling webhook "validation.gatekeeper.sh": ... context deadline exceeded` blocks every deployIntermediateKyverno is down and now the whole cluster, including Kyverno's own namespace, cannot be fixed because writes are rejectedAdvanced