kubectl get pods The connection to the server localhost:8080 was refused - did you specif...


The connection to the server localhost:8080 was refused - did you specify the right host or port?

原因:kubectl命令需要使用kubernetes-admin来运行。

解决办法:

1.将主节点中的/etc/kubernetes/admin.conf文件拷贝到从节点相同目录下

2.配置环境变量
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile

   3.立即生效

source ~/.bash_profile

 




免责声明!

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



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