How do I copy all resources to a new namespace?
问题 I would like to create a new namespace which is identical to the old one. My approach would look something like this (full command below): kubectl get <resources> -o json --namespace OLD-NAMESPACE | jq '.items[].metadata.namespace = "NEW-NAMESPACE"' | kubectl create -f - This basically gets all resource definitions in a json format, replaces the old namespace with the new one, and applies everything. Unfortunately, this does not work, since the old definitions contain namespace specific