首页 > 其他 > 详细

k8s集群报错:The connection to the server localhost:8080 was refused - did you specify the right host or port?

时间:2021-03-17 22:55:11      阅读:92      评论:0      收藏:0      [点我收藏+]
root@k8s-master:~# kubectl get node
The connection to the server localhost:8080 was refused - did you specify the right host or port?

 

原因:使用kubeadm安装的k8s集群的/etc/kubernetes/admin.conf 为设置环境变量

 

解决方法设置环境变量并设置系统启动生效,并设置立即生效:

root@k8s-master:~# echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
root@k8s-master:~# source ~/.bash_profile

 

k8s集群报错:The connection to the server localhost:8080 was refused - did you specify the right host or port?

原文:https://www.cnblogs.com/netsa/p/14551949.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!