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:
-
Kubernetes version (use
kubectl version
): 1.9.2 -
Cloud provider or hardware configuration: CPU#/GHZ: 2, 1 GHz RAM: 16 GB
-
OS (e.g. from /etc/os-release): NAME=“Ubuntu” VERSION=“16.04.3 LTS (Xenial Xerus)” ID=ubuntu ID_LIKE=debian PRETTY_NAME=“Ubuntu 16.04.3 LTS” VERSION_ID=“16.04” HOME_URL=“http://www.ubuntu.com/” SUPPORT_URL=“http://help.ubuntu.com/” BUG_REPORT_URL=“http://bugs.launchpad.net/ubuntu/” VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial
-
Kernel (e.g.
uname -a
): Linux ECS-9ce3f5ca 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux -
Install tools: Followed https://kubernetes.io/docs/setup/independent/install-kubeadm/
-
Others:
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 18 (1 by maintainers)
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 ressurectedHad 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…
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 KubernetesI 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.