kubernetes: node节点不能显示pod

Posted on 2019-11-21 12:01  xiaoyongyang  阅读(833)  评论(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 

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3