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

    0关注

    1477博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

kubernetes 一个窗口可以使用kubectl 另一个窗口不可以The connection to the server localhost:8080 was refused - did you

软件工程小施同学 发布时间:2020-10-16 19:51:24 ,浏览量:0

这是一个虚拟机内,为master节点,左边的窗口可以正常使用kubetl,右边就没法用,提示 The connection to the server localhost:8080 was refused - did you specify the right host or port?

方法一:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

https://blog.csdn.net/M82_A1/article/details/99671934

 

方法二:

不好用那个窗口是不是没有执行 

export KUBECONFIG=/etc/kubernetes/admin.conf

 

可以将这条命令写入~/.bashrc中,然后source ~/.bashrc,这样在一个node上开多个窗口也不用每次export上述变量了。

 

(没有试过)

https://coding.imooc.com/learn/questiondetail/208554.html

 

 

 

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

微信扫码登录

0.0453s