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

如果在node节点上执行kubectl get node报
The connection to the server localhost:8080 was refused - did you specify the right host or port?

1.将master 节点中 /etc/kubernetes/admin,conf拷贝到需要运行的服务器的 /etc/kubernetes 目录中
scp /etc/kubernetes/admin.conf root@node IP地址:/etc/kubemetes

2.在对应的服务器上配置环境变量
echo "export KUBECONFIG=/etc/kubernetes/admin.conf">>~/.bash_profile

3.配置生效
source ~/.bash_profile

你可能感兴趣的:(K8s报错收集,kubernetes)