How to tell which PSP my pod is validated against

11/7/2019

When creating a simple pod on Kubernetes with an RBAC enabled cluster, and where a pod security policy is enabled for the role, how can I view which PSP is successfully used to validate the request? Cluster is deployed with kubeadm.

-- Chris
kubeadm
kubernetes

1 Answer

11/7/2019

You can see the Pod Security Policy used by a Pod by looking at its annotations.

For instance:

kubectl get pod POD_NAME -o jsonpath='{.metadata.annotations}'
-- Alassane Ndiaye
Source: StackOverflow