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.
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 deployIntermediateGatekeeper constraint is created but violations are not blocked; `kubectl get constraint` shows `TOTAL-VIOLATIONS: 12`Intermediate