通过kubectl连接多集群 使用配置凭证 把上述config文件配置到home的下面目录: [docker@10 ~]$ mkdir p $HOME/.kube [docker@10 ~]$ mv config $HOME/.kube 使用kubectl命令切换集群上下文: [docker@10 ~]$ kubectl config usecontext clusteracontext Switched to context "clusteracontext". [docker@10 ~]$ kubectl clusterinfo Kubernetes master is running at KubeDNS is running at To further debug and diagnose cluster problems, use 'kubectl clusterinfo dump'. [docker@10 ~]$ kubectl config usecontext clusterbcontext Switched to context "clusterbcontext". [docker@10 ~]$ kubectl clusterinfo Kubernetes master is running at CoreDNS is running at To further debug and diagnose cluster problems, use 'kubectl clusterinfo dump'.