我是靠谱客的博主 玩命哑铃,这篇文章主要介绍k8s kubectl the server localhost:8080 was refused,现在分享给大家,希望可以做个参考。

次时使用kubectl命令会提示错误

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

解决办法:

对于非root用户
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
对于root用户
export KUBECONFIG=/etc/kubernetes/admin.conf
也可以直接放到~/.bash_profile
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile

最后

以上就是玩命哑铃最近收集整理的关于k8s kubectl the server localhost:8080 was refused的全部内容,更多相关k8s内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部