使用kubectl命令报错

The connection to the server localhost:8080 was refused - did you specify the right host or port?
(1)在master节点上执行

scp -r /etc/kubernetes/admin.conf 10.170.39.10:/etc/kubernetes/admin.conf

然后根据提示输入yes
(2)在从节点上执行

echo export KUBECONFIG=/etc/kubernetes/admin.conf >> ~/.bash_profile
source ~/.bash_profile

你可能感兴趣的:(k8s)