A Kyverno policy excluded `kube-system` by namespace, yet a system DaemonSet is still blocked after a Helm upgrade
IntermediateTroubleshootingKubernetes admission control and Pod Security
Answer
Likely causes → The upgraded chart installs into a different namespace (e.g. aws-observability, monitoring), or the exclusion uses namespaces under match instead of exclude.
Diagnose →
kubectl get clusterpolicy disallow-host-path -o yaml | yq '.spec.rules[] | {match, exclude}'
kubectl get ds -A | grep <name>
Fix → Add a narrowly scoped exclude (namespace + workload name) or a PolicyException resource with the exact justification.
Prevent → Use Kyverno PolicyException objects in Git with owners and expiry instead of editing policies.
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