Skip to content

Commit 453f4e6

Browse files
committed
Reference the kubernetes.io/psp annotation on the PodSecurityPolicy concept page
1 parent 60ee2c2 commit 453f4e6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

content/en/docs/concepts/security/pod-security-policy.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ controller selects policies according to the following criteria:
214214
2. If the pod must be defaulted or mutated, the first PodSecurityPolicy
215215
(ordered by name) to allow the pod is selected.
216216

217+
When a Pod is validated against a PodSecurityPolicy, [a `kubernetes.io/psp` annotation](/docs/reference/labels-annotations-taints/#kubernetes-io-psp)
218+
is added with its name as its value.
219+
217220
{{< note >}}
218221
During update operations (during which mutations to pod specs are disallowed)
219222
only non-mutating PodSecurityPolicies are used to validate the pod.
@@ -332,7 +335,15 @@ The output is similar to this
332335
pod "pause" created
333336
```
334337
335-
It works as expected! But any attempts to create a privileged pod should still
338+
It works as expected! You can verify that the pod was validated against the
339+
newly created PodSecurityPolicy:
340+
341+
```shell
342+
kubectl-user get pod pause -o yaml | grep kubernetes.io/psp
343+
kubernetes.io/psp: example
344+
```
345+
346+
But any attempts to create a privileged pod should still
336347
be denied:
337348

338349
```shell

0 commit comments

Comments
 (0)