kubectl出现The connection to the server localhost:8080 was refused

输入kubectl命令遇到错误:

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server localhost:8080 was refused - did you specify the right host or port?

解决方案:

mkdir -p $HOME/.kube

sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

sudo chmod -R 777 $HOME/.kube/config

你可能感兴趣的:(k8s,kubernetes,linux,docker)