kubectl切换kubernetes多集群

  sre

5fc9f872cba12358.jpg_fo742.jpg
kubectl切换kubernetes多集群
将多config文件合并

KUBECONFIG=file1:file2:file3 kubectl config view --merge --flatten > ~/.kube/all-config
export KUBECONFIG=~/.kube/all-config

查看contexts候选列表

kubectl config get-contexts

切换contexts

kubectl config use-context {your-contexts}

LEAVE A COMMENT

Captcha Code