您当前的位置: 首页 >  kubernetes
  • 1浏览

    0关注

    1477博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Kubernetes kubectl The connection to the server localhost:8080 was refused - did you specify the rig

软件工程小施同学 发布时间:2020-10-14 19:20:06 ,浏览量:1

一、问题

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】文件拷贝到从节点相同目录下
scp /etc/kubernetes/admin.conf root@192.168.18.133:/etc/kubernetes

2.从节点配置环境变量
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
3. 使该文件立即生效
source ~/.bash_profile
4. 接着再运行kubectl命令就OK了

 

参考:https://www.jianshu.com/p/6fa06b9bbf6a

 

 

 

关注
打赏
1665320866
查看更多评论
立即登录/注册

微信扫码登录

0.1442s