kubernetes: node节点不能显示pod

Posted on 2019-11-21 12:01  xiaoyongyang  阅读(816)  评论(0编辑  收藏  举报

[root@k8s-node01~]# kubectl  get pods

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

 

解决方法:

[root@k8s-master ~]# scp -r /etc/kubernetes/admin.conf root@k8s-node01:/etc/kubernetes/    --k8s-node01改成节点IP,将admin.conf文件拷贝到其它从节点 

[root@k8s-node01 ~]# vim /root/.bash_profile       --在各个从节点添加环境变量

export KUBECONFIG=/etc/kubernetes/admin.conf

[root@k8s2 ~]# source  /root/.bash_profile 

Copyright © 2024 xiaoyongyang
Powered by .NET 9.0 on Kubernetes