PodSecurityPolicy (beta) is deprecated in Kubernetes version 1.21 and removed in
version 1.25. To learn more, refer to the [PodSecurityPolicy deprecation blog
post](https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/).
For Google Kubernetes Engine (GKE) clusters running version 1.25 or later, you can
no longer use PodSecurityPolicy, and you must disable the feature before
upgrading to versions 1.25 or later. For instructions, refer to [Migrate from
PodSecurityPolicy](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/migrate-podsecuritypolicy#disable-psp).

## Alternatives to PodSecurityPolicy

If you want to continue using Pod-level security controls in GKE,
we recommend one of the following solutions:

- **Use the `PodSecurity` admission controller** : You can use the
  [`PodSecurity` admission controller](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/podsecurityadmission.md.txt)
  to apply Pod Security Standards to Pods running on your GKE
  Standard and Autopilot clusters. Pod Security Standards
  are predefined security policies that meet the high-level needs of Pod
  security in Kubernetes. These policies are cumulative, and range from being
  highly permissive to being highly restrictive.

  To migrate your existing PodSecurityPolicy configuration to `PodSecurity`,
  refer to
  [Migrate from PodSecurityPolicy](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/migrate-podsecuritypolicy.md.txt).
- **Use Policy Controller with the Pod Security Policy bundle** :
  Policy Controller lets you apply and enforce security policies in your GKE
  clusters. Policy Controller [*bundles*](https://docs.cloud.google.com/kubernetes-engine/policy-controller/docs/concepts/policy-controller-bundles.md.txt),
  like the Pod Security Policy bundle, let you enforce the same validations as
  PodSecurityPolicy with capabilities such as dry-run and fine-grained control
  over resource coverage.

  For more information, refer to
  [Use Policy Controller's Pod Security Policy bundle](https://docs.cloud.google.com/kubernetes-engine/policy-controller/docs/how-to/using-constraints-to-enforce-pod-security.md.txt).
- **Use Gatekeeper**: GKE Standard clusters allow you
  to apply security policies using Gatekeeper. You can use Gatekeeper to
  enforce the same capabilities as PodSecurityPolicy, as well as take
  advantage of other functionality such as dry-run, gradual rollouts, and
  auditing.

  For more information, refer to
  [Apply custom Pod-level security policies using Gatekeeper](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies-with-gatekeeper.md.txt).
- **Use GKE Autopilot clusters**: GKE
  Autopilot clusters implement many of the recommended security
  policies by default.

  For more information, refer to the
  [Autopilot overview](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview.md.txt).

## View deprecation insights and recommendations

You can check which clusters use this deprecated feature by using
[deprecation insights](https://docs.cloud.google.com/kubernetes-engine/docs/deprecations/viewing-deprecation-insights-and-recommendations.md.txt#view-deprecation-insights-recs).
Deprecation insights for this feature are supported for clusters running any
GKE version.