kubernetes: node节点不能显示pod

[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/    --将admin.conf文件拷贝到其它从节点 

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

export KUBECONFIG=/etc/kubernetes/admin.conf

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

猜你喜欢

转载自www.cnblogs.com/xiaoyongyang/p/11904742.html