What happened: when I reboot the centos7 server and run get pod, see below error:
The connection to the server localhost:8080 was refused - did you specify the right host or port? What you expected to happen:
before I reboot the system, the Kubernetes have three nodes, and pods/service/,.. all working fine. How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?
I even used sudo kubeadm reset
and init
again but the issue still exists!
There are few things to consider:
kubeadm reset performs a best effort revert of changes made by kubeadm init or kubeadm join. So some configurations may stay on the cluster.
Make sure you run kubectl
as a proper user. You might need to copy the admin.conf
to .kube/config
dir of the user's home directory.
After kubeadm init
you need to run the following commands:
sudo cp /etc/kubernetes/admin.conf $HOME/ sudo chown $(id -u):$(id -g) $HOME/admin.conf export KUBECONFIG=$HOME/admin.conf
Make sure you do so.
Please let me know if that helped.