kubernetes: kubectl stopped working after reboot

/kind bug

What happened: I’ve installed Kubernetes 1.9.2 on the master node (Ubuntu 16.04) including the dashboard. All the pods were running fine. But after rebooting, when I try to run kubectl get nodes or kubectl get pods I get:

The connection to the server 10.50.88.230:6443 was refused - did you specify the right host or port?

If I run kubectl cluster-info I get:

Kubernetes master is running at https://10.50.88.230:6443

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server 10.50.88.230:6443 was refused - did you specify the right host or port?

But if I run kubectl cluster-info dump I get the same error.

What you expected to happen: See the list of nodes and work as usual

How to reproduce it (as minimally and precisely as possible): I’ve installed Kubernetes 1.9.2 on the master node (Ubuntu 16.04) including the dashboard and using Flannel as pod network. All seemed to run fine. Then I rebooted and I got that error.

Anything else we need to know?:

Environment:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 18 (1 by maintainers)

Most upvoted comments

I don’t know WTF, but after export KUBECONFIG=$HOME/.kube/config sudo systemctl restart docker sudo systemctl restart kubelet on master node, my cluster is ressurected

Had prob same issue as restart broke it for me with same error message… My env variable was the issue which was set to blank after restart… solution for me was: export KUBECONFIG=$HOME/.kube/config

Works after that…

I don’t know WTF, but after export KUBECONFIG=$HOME/.kube/config sudo systemctl restart docker sudo systemctl restart kubelet on master node, my cluster is ressurected

Thanks a lot @DamienVStone this worked for me.

Worked for me in Windows 10: 1st: Execute in command line: ipconfig /flushdns 2st: Restart Docker and Kubernetes

I have this script now in my autostart folder and it works fine.

Just like @DamienVStone mentioned. Be sure to check docker and kubelet status and start/restart them.