Created
February 12, 2018 03:55
-
-
Save johnmarcou/fd75e027683cf5c2a92c0bdad8cb7de2 to your computer and use it in GitHub Desktop.
Merge kubeconfig 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
kmerge() { | |
NEW_KUBECONFIG=$1 | |
ACTIVE_KUBECONFIG=${KUBECONFIG:-~/.kube/config} | |
BACKUP_KUBECONFIG=$ACTIVE_KUBECONFIG.bak | |
cp $ACTIVE_KUBECONFIG $BACKUP_KUBECONFIG 2>/dev/null || : | |
KUBECONFIG=$BACKUP_KUBECONFIG:$NEW_KUBECONFIG kubectl config view --flatten > $ACTIVE_KUBECONFIG | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment