Created
August 2, 2016 13:40
-
-
Save simonswine/6bf3b665e4117f42b550c3ea12dd171a to your computer and use it in GitHub Desktop.
Copying kubernetes resources accross namespaces
This file contains 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 rs,secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create-f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wanted too make a copy all my resources running in sandbox namespace to staging namespace , Hence tired running this following cmd
kubectl get rs,secrets -o json --namespace sandbox | jq '.items[].metadata.namespace = "staging"' | kubectl create -f -
A copy of my resources gets created inside staging namespace, all the pods fails with an error:
authorization-55b866f8c4-7nkxp 0/1 CreateContainerConfigError 0 77s
consults-6b796cf5f4-wrjbf 0/1 CreateContainerConfigError 0 77s
core-api-8dd575db9-9bgth 0/1 CreateContainerConfigError 0 77s
what I am doing wrong? I just wanted to make a copy of this resources into staging namespace and play around