ubuntu搭建k8s:The connection to the server localhost:8080 was refused - did you specify the right h...

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

切换到root用户(如果密码不对自行百度)

su root

再执行一遍

sudo kubeadm reset
sudo kubeadm init
export KUBECONFIG=/etc/kubernetes/admin.conf
sudo kubectl apply -f canal.yaml
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

网络配置随意

sudo kubectl apply -f canal.yaml

你可能感兴趣的:(ubuntu搭建k8s:The connection to the server localhost:8080 was refused - did you specify the right h...)