[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