Last active
March 23, 2018 11:01
-
-
Save mclarke47/090a7f9b94fc278e365dd08085add5b5 to your computer and use it in GitHub Desktop.
Generate a script to delete all kubernetes service account token
This file contains hidden or 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
kubectl get secrets --all-namespaces -o=json | jq -r '.items[] | select(.type=="kubernetes.io/service-account-token") | "kubectl delete secret \(.metadata.name) -n \(.metadata.namespace)"' > refresh-api-tokens.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment