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

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

The situation differs for everyone, so as the cause. Let's list out some of them:

Reason 1 :

The kubelet is not running. Your master node might have a got a reboot and the service did not come up after reboot.

systemctl staus kubelet.service

If it is stopped then start it:

systemctl start kubelet.service

Reason 2: 

The docker service may not be ruuning.
systemctl status docker

If it is stopped then start it:
systemctl start docker

Reason 3:

Swap may not be off.

Kubelet service may be down. This may be due to the fact that swap is enabled.
To disable swap :

swapoff -a

To make it permanent comment it in /etc/fstab

Reason 4:

The Kubeconfig environmental variable is probably not set.
export KUBECONFIG=/etc/kubernetes/admin.conf or $HOME/.kube/config

Reason 5:

The user’s $HOME directory has no .kube/config file. If you don’t have a .kube or config file
mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf HOME/.kube/config
chown (id -u):$(id -g) $HOME/.kube/config

Reason 6:

Firewalls may be blocking the access
 systemctl status firewalld
 systemctl stop firewalld

Reason 7 :

You can try this procedure. This may work sometimes.
sudo -i
swapoff -a
exit
strace -eopenat kubectl version

0 Response to "The connection to the server 10.192.5.105:6443 was refused - did you specify the right host or port?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel