Pod Security Policies (or PSPs) are objects that control security-sensitive aspects of pod specification (like root privileges). If a pod does not meet the conditions specified in the PSP, Kubernetes will not allow it to start, and Rancher will display an error message of Pod <NAME> is forbidden: unable to validate....

Read more about Pod Security Policies in the Kubernetes Documentation.

Best Practice: Set pod security at the cluster level.

Using Rancher, you can create a Pod Security Policy using our GUI rather than creating a YAML file.

Default Pod Security Policies

Available as of v2.0.7

Rancher ships with two default Pod Security Policies (PSPs): the restricted and unrestricted policies.

Creating Pod Security Policies

  1. From the Global view, select Security > Pod Security Policies from the main menu. Then click Add Policy.

    Step Result: The Add Policy form opens.

  2. Name the policy.

  3. Complete each section of the form. Refer to the Kubernetes documentation linked below for more information on what each policy does.

What's Next?

You can add a Pod Security Policy (PSPs hereafter) in the following contexts:

Note: We recommend adding PSPs during cluster and project creation instead of adding it to an existing one.