Last active
January 26, 2021 18:34
-
-
Save jcderr/f9d9832ca3d12298a1387773000a457f to your computer and use it in GitHub Desktop.
Copy a Kubernetes Context
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
#!/bin/bash | |
FROM=$1 | |
[[ -n "$FROM" ]] || exit 1 | |
for ITEM in ns secrets configmaps rc deployments svc; do | |
for OBJ in $(kubectl --context=$FROM get $ITEM -o name); do | |
kubectl --context=$FROM get $OBJ -o yaml | kubectl create -f - | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment