我是靠谱客的博主 醉熏高跟鞋,这篇文章主要介绍【The connection to the server localhost:8080 was refused - did you specify the right host or port?】,现在分享给大家,希望可以做个参考。

问题

k8s报错

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

解决方法

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

sudo scp admin.conf 172.19.5.160:/etc/kubernetes/

进入worker节点,更改 admin.conf 权限

chmod 666 /etc/kubernetes/admin.conf

配置环境变量,使之生效

echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
source ~/.bash_profile

最后

以上就是醉熏高跟鞋最近收集整理的关于【The connection to the server localhost:8080 was refused - did you specify the right host or port?】的全部内容,更多相关【The内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(40)

评论列表共有 0 条评论

立即
投稿
返回
顶部