我是靠谱客的博主 大意小蚂蚁,最近开发中收集的这篇文章主要介绍kubeadm报错:The connection to the server localhost:8080 was refused - did you specify the right hostThe connection to the server localhost:8080 was refused - did you specify the right host or port?,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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

报错现象

[root@k8s-node1 ~]# kubectl apply -f calico.yaml
The connection to the server localhost:8080 was refused - did you specify the right host or port?

报错原因

kubectl命令需要使用kubernetes-admin来运行

解决方法

将主节点(master节点)中的【/etc/kubernetes/admin.conf】文件拷贝到从节点相同目录下:
scp -r /etc/kubernetes/admin.conf ${node1}:/etc/kubernetes/admin.conf
配置环境变量:
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
立即生效:
source ~/.bash_profile

最后

以上就是大意小蚂蚁为你收集整理的kubeadm报错:The connection to the server localhost:8080 was refused - did you specify the right hostThe connection to the server localhost:8080 was refused - did you specify the right host or port?的全部内容,希望文章能够帮你解决kubeadm报错:The connection to the server localhost:8080 was refused - did you specify the right hostThe connection to the server localhost:8080 was refused - did you specify the right host or port?所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部