Error in configuration: context was not found for specified context: kubernetes-kind-2-admin@kind-2

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shida_csdn/article/details/85098392

使用 kind (kubernetes in docker) 工具部署多集群,切换集群后执行 kubectl 出现如下问题:

Error in configuration: context was not found for specified context: kubernetes-kind-2-admin@kind-2

问题分析:

1. 查看存在的 kubectl context

# kubectl config get-contexts

    

2. 发现 CURRENT 为空,即没选中任何 context

    执行 kubectl config use-context cluster2

    

3. 配置多 context

# export KUBECONFIG="kube-config-1:kube-config-2:..."           # 多个配置文件用引号隔开

     

猜你喜欢

转载自blog.csdn.net/shida_csdn/article/details/85098392