编程语言
首页 > 编程语言> > k8s节点node报错The connection to the server localhost:8080 was refused - did you specify the right host

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

 

标签:node,v1.19,right,admin,master,conf,node1,报错,节点
来源: https://www.cnblogs.com/tyjs09/p/16091500.html