after some time my kubernetes cluster does not work

3/26/2019

I have kubernetes cluster.every thing work fine. but after 8 days when i run kubectl get pods it shows:

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

I have one master and one worker. I run them in my lab without any cloud.

systemctl kubelet status
show **node not found**

my /etc/hosts was checked and it is correct

-- yasin lachini
kubernetes

4 Answers

3/26/2019

most likely that the servers are rebooted. i had similar problem. check kubelet logs on master server and take action.

if you can share the kubelet logs then we will be able to offer you further help

-- P Ekambaram
Source: StackOverflow

3/26/2019

verify /var/log/messages to get further information about the error

or

systemctl status kubelet

or

Alternately journalctl will also show the details.

-- Anil Jayan Leela
Source: StackOverflow

3/26/2019

Reboot itself should not be a problem - but if you did not disabled swap permanently reboot will enable swap again and API server will not launch - it could be first shot.

Second - check free disk space, API server will not respond if disk is full (will raise disk pressure event and will try to evict pods).

If it will not help - please add logs from Kubelet (systemctl and journalctl).

-- toszo
Source: StackOverflow

3/28/2019

i have lack of hardware. I run this command to solve the issue

sudo -i
swapoff -a
exit
strace -eopenat kubectl version
-- yasin lachini
Source: StackOverflow