Snippet: Merge Kube-Configs
Merge all kube-configs in ~/.kube/
.
cd ~/.kube/
mv config config.bak
echo "Merging: $(ls -p *.config | grep -v / | tr '\n' ' ')"
export KUBECONFIG=~/.kube/config:$(ls -p *.config | grep -v / | tr '\n' ':')
kubectl config view --flatten > config
chmod 600 config
kubectl config get-contexts