Last active
October 19, 2022 23:03
-
-
Save svennam92/fbc8750e87f1070bf15b88759672203b to your computer and use it in GitHub Desktop.
Kubernetes PSP (Pod Security Policy) Checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PSPs will be removed from Kubernetes in the 1.25 release | |
# Run this command to see which pods in your cluster are still associated with a PSP | |
kubectl get pod -A -o jsonpath='{range .items[?(@.metadata.annotations.kubernetes\.io/psp)]}{.metadata.name}{"\t"}{.metadata.annotations.kubernetes\.io/psp}{"\t"}{.metadata.namespace}{"\n"}' | |
# Example output (podname, psp name, namespace): | |
carts-dynamodb-cc5bf4649-8mp66 privileged carts | |
catalog-7c5d554d84-nzqph privileged catalog | |
checkout-66b6dcbc45-x7jj6 privileged checkout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment