Created
November 4, 2022 21:00
-
-
Save echo-devnull/812d662aae58f7c365acd4c673272a16 to your computer and use it in GitHub Desktop.
Merging seperate kubeconfig files into one
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
function mergeKubeConfigs() { | |
kube_config_dir="$HOME/.kube/config.d/" | |
for f in `ls $kube_config_dir | grep config.` | |
do | |
export KUBECONFIG="$kube_config_dir/$f:$KUBECONFIG"; | |
done | |
kubectl config view --raw >> ~/.kube/config | |
unset KUBECONFIG | |
export KUBECONFIG="$HOME/.kube/config" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment