Skip to content

Instantly share code, notes, and snippets.

@mshafiee
Last active January 9, 2021 17:35
Show Gist options
  • Save mshafiee/c23668c1ab87b2eb160090f93f75f1a0 to your computer and use it in GitHub Desktop.
Save mshafiee/c23668c1ab87b2eb160090f93f75f1a0 to your computer and use it in GitHub Desktop.
Dump all secrets from all namespaces
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