我是靠谱客的博主 丰富汽车,这篇文章主要介绍kubernetes 一个窗口可以使用kubectl 另一个窗口不可以The connection to the server localhost:8080 was refused - did you,现在分享给大家,希望可以做个参考。
这是一个虚拟机内,为master节点,左边的窗口可以正常使用kubetl,右边就没法用,提示
The connection to the server localhost:8080 was refused - did you specify the right host or port?
方法一:
复制代码
1
2
3mkdir -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
最后
以上就是丰富汽车最近收集整理的关于kubernetes 一个窗口可以使用kubectl 另一个窗口不可以The connection to the server localhost:8080 was refused - did you的全部内容,更多相关kubernetes内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复