the connection to the server 6443 was refused - did you specify the right host or port? 问题的解决方法


问题产生

 k8s 虚拟机重启之后,使用 kubectl get nodes 命令报出如下错误:

# kubectl get nodes
The connection to the server <master>:6443 was refused - did you specify the right host or port?

 

解决方法:

1. 编辑 /etc/profile

vim /etc/profile

2. 在里面添加:

export KUBECONFIG=/etc/kubernetes/admin.conf

3. 使生效

source /etc/profile

4. 关机重启一下


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM