Last active
January 9, 2021 17:35
-
-
Save mshafiee/c23668c1ab87b2eb160090f93f75f1a0 to your computer and use it in GitHub Desktop.
Dump all secrets from all namespaces
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
Dump all secrets from all namespaces and store them in seprate yaml file: | |
kubectl get secret -A -o custom-columns=:.metadata.name,:.metadata.namespace --no-headers | \ | |
xargs -n 2 sh -c '(kubectl get secret -n $3 -o yaml $2; echo "---") >> $3-$2.yaml' -- {} | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment