多個(gè)集群配置在一個(gè)config文件中需要自己維護(hù)編寫肄满,多個(gè)文件方便管理和區(qū)分羞酗。
https://kubernetes.io/zh/docs/tasks/access-application-cluster/configure-access-multiple-clusters/
安裝kubectl
$ brew install kubectl
$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.3", GitCommit:"06ad960bfd03b39c8310aaf92d1e7c12ce618213", GitTreeState:"clean", BuildDate:"2020-02-13T18:08:14Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"darwin/amd64"}
新建第二個(gè)配置文件
~/.kube 目錄下添加一個(gè) config-2 文件
export KUBECONFIG=$KUBECONFIG:~/.kube/config:~/.kube/config-2
source ~/.bash_profile
kubectl config view
可以看到兩個(gè)配置文件合并后的結(jié)果