kubeadm reset
sudo rm -rf $HOME/.kube
kubeadm init --kubernetes-version=1.18.1 --apiserver-advertise-address=192.168.8.45 --image-repository registry.aliyuncs.com/google_containers --service-cidr=10.10.0.0/16 --pod-network-cidr=10.122.0.0/16 --ignore-preflight-errors=Swap
sudo 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 get nodes
正常输出就可以了