Last active
August 2, 2021 03:25
-
-
Save tonidy/9d005b81b170a3b46256ec9e4a943ced to your computer and use it in GitHub Desktop.
Merge 2 kubernetes config files
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
## Using: | |
## to see newconfig | |
## make view newconfig=~/new-config.yaml | |
## to merge configs | |
## make merge newconfig=~/new-config.yaml | |
view:: | |
cp ~/.kube/config ~/.kube/config.bak && KUBECONFIG=~/.kube/config:$(newconfig) kubectl config view --flatten > /tmp/config && cat /tmp/config | |
merge:: | |
cp ~/.kube/config ~/.kube/config.bak && KUBECONFIG=~/.kube/config:$(newconfig) kubectl config view --flatten > /tmp/config && mv /tmp/config ~/.kube/config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment