Skip to content

Instantly share code, notes, and snippets.

@mclarke47
Last active March 23, 2018 11:01
Show Gist options
  • Save mclarke47/090a7f9b94fc278e365dd08085add5b5 to your computer and use it in GitHub Desktop.
Save mclarke47/090a7f9b94fc278e365dd08085add5b5 to your computer and use it in GitHub Desktop.
Generate a script to delete all kubernetes service account token
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