Interview Prep/DevSecOps/Kubernetes admission control and Pod Security

Kyverno is down and now the whole cluster, including Kyverno's own namespace, cannot be fixed because writes are rejected

AdvancedTroubleshootingKubernetes admission control and Pod Security
Answer

Likely causes → Fail-closed webhooks that match all namespaces, including the one Kyverno needs to recover.

Diagnose →

kubectl get validatingwebhookconfigurations,mutatingwebhookconfigurations | grep kyverno
kubectl -n kyverno get pods

Fix → Break glass: temporarily delete the Kyverno webhook configurations (Kyverno recreates them when healthy), recover the pods, and confirm webhooks return.

kubectl delete validatingwebhookconfiguration kyverno-resource-validating-webhook-cfg
kubectl delete mutatingwebhookconfiguration kyverno-resource-mutating-webhook-cfg

Prevent → Exclude kube-system and kyverno namespaces in webhook config, HA replicas, and a documented break-glass runbook with audited access.

All DevSecOps questions Roadmap: Policy as code

More on Kubernetes admission control and Pod Security