Last active
July 6, 2024 13:12
-
-
Save adamency/b92bf632dd04f02b967edd07374c5c90 to your computer and use it in GitHub Desktop.
Move Kubernetes Resource from one namespace to another
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
kubectl get -n <old_namespace> <kind> <resource> -o json |\ | |
jq '.metadata.namespace = "<new_namespace>"' |\ | |
kubectl create -f - &&\ | |
kubectl delete -n <old_namespace> <kind> <resource> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@PrimeDominus This is what I explained in the comment above. But always a good idea to add more information :). Thanks for starring the gist !