Pod Security Policy not working as intended
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
When Pod Security Policy appears to "not work", the first thing to check is the Kubernetes version. On older clusters, PSP depended on both admission-controller enablement and RBAC permissions. On modern clusters, the simpler answer is that Pod Security Policy was removed, so it will not enforce anything at all.
Check the Cluster Version First
This question splits immediately by Kubernetes version:
- on Kubernetes
1.24and earlier, PSP can still exist if the admission plugin is enabled - on Kubernetes
1.25and later, PSP is removed and should be replaced
So if you apply a PodSecurityPolicy object to a newer cluster and expect enforcement, nothing is wrong with your pod manifest. The feature itself is gone.
On Older Clusters, the YAML Was Never Enough
Even when PSP existed, creating the policy object alone did not enforce it. Two conditions had to be true:
- the PodSecurityPolicy admission controller had to be enabled on the API server
- the user or service account had to be authorized to
usea matching PSP
A minimal restrictive PSP looked like this:
That policy still did nothing if the admission plugin was off or no caller had permission to use it.
RBAC Was Often the Real Problem
A service account needed explicit RBAC permission for the use verb on the intended policy.
Then bind that permission to the service account:
If this binding was missing, the policy could exist in the cluster and still never apply to the workload you cared about.
Multiple PSPs Could Make Behavior Look Inconsistent
Another reason PSP felt unreliable is that a cluster might contain several policies. If the caller was allowed to use a more permissive policy, the pod could be admitted under that policy instead of the restrictive one you expected.
That made troubleshooting much harder, because the policy YAML itself might look correct while the effective policy was different.
When debugging older clusters, check:
- which PSPs exist
- which PSPs the service account can use
- whether a more permissive policy also matches the pod
Admission Configuration Could Be the Real Issue
On self-managed clusters, the control plane had to start with the PSP admission plugin enabled. If that was missing, the PSP objects were just inert API resources.
That produced a classic symptom:
- the PSP object was present
- applying it succeeded
- forbidden pods still ran
In that case, the control plane configuration was the problem, not the policy document.
Modern Replacement: Pod Security Admission
On current Kubernetes versions, the built-in replacement is Pod Security Admission. It uses namespace labels instead of PSP objects.
This is easier to reason about because enforcement is attached directly to the namespace and the policy levels are standardized.
If you need more custom policy logic than the built-in levels provide, tools such as Kyverno or OPA Gatekeeper are the usual next step.
Common Pitfalls
The biggest mistake is assuming that creating a PSP object alone ever guaranteed enforcement. On older clusters, admission and RBAC both had to be configured correctly.
Another common issue is troubleshooting PSP on Kubernetes 1.25+, where the feature no longer exists.
People also overlook permissive alternate PSPs that the service account is allowed to use, which makes the restrictive policy appear to be ignored.
Finally, do not focus only on the YAML. Cluster version, admission-controller setup, and service-account permissions are often the real cause.
Summary
- Pod Security Policy only worked on older Kubernetes clusters and required both admission and RBAC setup.
- On Kubernetes
1.25+, PSP is removed and will not enforce anything. - Missing
usepermissions were one of the most common causes of apparent PSP failure. - Multiple PSPs could make enforcement look inconsistent if a permissive one was also available.
- For modern clusters, use Pod Security Admission or another current policy engine instead.
Related reading
- pod shows existing but get pod not found error when running port-forward
- Pod status as CreateContainerConfigError in Minikube cluster
- Pod template for specifying tolerations when running Spark on Kubernetes
- Pods-resources.sh Permission denied in iOS Project
- Poor man's authentication algorithm?
- PreAuthorize not working on Controller
- Pods stuck in PodInitializing state indefinitely
- Pods stuck in Terminating status

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.