Interview Prep/DevSecOps/Kubernetes admission control and Pod Security

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.

All DevSecOps questions Roadmap: Policy as code

More on Kubernetes admission control and Pod Security