Pods do not appear, but `kubectl apply` of the Deployment succeeded
BeginnerTroubleshootingKubernetes admission control and Pod Security
Answer
Likely causes → Admission policies checked the Pod (created by the ReplicaSet controller), not the Deployment, so the rejection is recorded on the ReplicaSet, not shown to you.
Diagnose →
kubectl describe rs -l app=api | grep -A5 Events
kubectl get events -n prod --field-selector reason=FailedCreate
Look for admission webhook ... denied the request or violates PodSecurity.
Fix → Fix the pod template as the message says.
Prevent → Kyverno auto-generates rules for controllers (autogen); for Gatekeeper and PSA, validate workloads in CI too.
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`Beginner`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 rejectedAdvancedGatekeeper constraint is created but violations are not blocked; `kubectl get constraint` shows `TOTAL-VIOLATIONS: 12`Intermediate