在node节点上配置k8s,k8s报错:The connection to the server localhost:8080 was refused
kubectl 命令报错:[root@node01 ~]# kubectl get nodesThe connection to the server localhost:8080 was refused - did you specify the right host or port?报错原因:该节点未对kubernetes进行权限配置解决办法:1、拷贝master01节点的/etc/kuber
·
kubectl 命令报错:
[root@node01 ~]# kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?
报错原因:该节点未对kubernetes进行权限配置
解决办法:
1、拷贝master01节点的/etc/kubernetes/admin.conf配置文件到/etc/kubernetes/目录下
[root@node01 ~]# scp /etc/kubernetes/admin.conf master01:/etc/kubernetes/
2、执行如下命令:
To start using your cluster, you need to run the following as a regular user:
[root@node01 ~]# mkdir -p $HOME/.kube
[root@node01 ~]# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[root@node01 ~]# sudo chown $(id -u):$(id -g) $HOME/.kube/config
3、配置成功
[root@node01 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master01 Ready control-plane,master 5h47m v1.20.6
node01 Ready <none> 5h36m v1.20.6
node02 Ready <none> 5h36m v1.20.6
更多推荐
已为社区贡献3条内容
所有评论(0)