k8s节点node报错The connection to the server localhost:8080 was refused - did you specify the right host

2022/4/2 14:19:37

本文主要是介绍k8s节点node报错The connection to the server localhost:8080 was refused - did you specify the right host,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

解决办法:

将master节点上的admin.conf文件拷贝到从节点

1在master节点上执行传文件

[root@master .kube]# scp /etc/kubernetes/admin.conf node1:~
Password: 
admin.conf                                                                                                                                                              100% 5562     2.1MB/s   00:00    

2在node节点上执行配置环境变量:

[root@node1 ~]# export KUBECONFIG=$HOME/admin.conf

3在node的节点上查看

[root@node1 ~]# kubectl get nodes
NAME     STATUS   ROLES    AGE    VERSION
master   Ready    master   3d4h   v1.19.3
node1    Ready    <none>   3d2h   v1.19.3
node2    Ready    <none>   3d2h   v1.19.3

 



这篇关于k8s节点node报错The connection to the server localhost:8080 was refused - did you specify the right host的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程