k8s The connection to the server localhost:8080 was refused

kubeadm 配置好 master 节点后,提示了:

To start using your cluster, you need to run (as a regular user):

sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf

按照这个在 master 节点上操作后再使用 kubectl 。

原文地址:https://www.cnblogs.com/gao88/p/10506056.html