Skip to content

Instantly share code, notes, and snippets.

@jeesmon
Created October 28, 2021 18:26
Show Gist options
  • Save jeesmon/773393ac906c416e8447b39dcde7443b to your computer and use it in GitHub Desktop.
Save jeesmon/773393ac906c416e8447b39dcde7443b to your computer and use it in GitHub Desktop.
Copy and apply kubernetes Secret from one namespace to another
kubectl get secret <name> -n <namespace> -o json \
| jq '.metadata.name="<new_name>"|.metadata.namespace="<new_namespace>"' \
| kubectl apply -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment