Skip to content

Instantly share code, notes, and snippets.

@adamency
Last active July 6, 2024 13:12
Show Gist options
  • Save adamency/b92bf632dd04f02b967edd07374c5c90 to your computer and use it in GitHub Desktop.
Save adamency/b92bf632dd04f02b967edd07374c5c90 to your computer and use it in GitHub Desktop.
Move Kubernetes Resource from one namespace to another
kubectl get -n <old_namespace> <kind> <resource> -o json |\
jq '.metadata.namespace = "<new_namespace>"' |\
kubectl create -f - &&\
kubectl delete -n <old_namespace> <kind> <resource>
@adamency
Copy link
Author

adamency commented Jul 6, 2024

@PrimeDominus This is what I explained in the comment above. But always a good idea to add more information :). Thanks for starring the gist !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment