How to Merge Multiple kubeconfig Files into One

Merge Multiple Kubernetes kubectl config files into a single

cp ~/.kube/config ~/.kube/config-backup
export KUBECONFIG=~/.kube/config:/path/cluster1:/path/cluster2
export KUBECONFIG=~/.kube/config:$(find . -type f | tr '\n' ':')
kubectl config view --flatten > all-in-one-kubeconfig.yaml
mv all-in-one-kubeconfig.yaml ~/.kube/config
kubectl config get-clusters

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Able Lv

Cloud Infrastructure Engineer @Airwallex: Kubernetes, DevOps, Terraform, Istio, Go, and Cloud-Native stuff