Interview Prep/DevSecOps/Kubernetes admission control and Pod Security

Gatekeeper `audit` reports violations for resources that no longer exist

IntermediateTroubleshootingKubernetes admission control and Pod Security
Answer

Likely causes → Audit results are refreshed on an interval (default 60s) and capped by --constraint-violations-limit; status can lag, or audit pods are failing.

Diagnose →

kubectl -n gatekeeper-system logs deploy/gatekeeper-audit | tail
kubectl get k8srequiredlabels require-team -o jsonpath='{.status.auditTimestamp}'

Fix → Fix the audit pod (memory limits are a common cause on big clusters) and wait for the next cycle.

Prevent → Size audit resources for cluster object count and use --audit-from-cache with sync config for what you query.

All DevSecOps questions Roadmap: Policy as code

More on Kubernetes admission control and Pod Security