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


Problem:  kubectl get nodes shows an error The connection to the server IP:6443 was refused - did you specify the right host or port?

Solution: Make sure you disable memory swapping if you are on Linux Ubuntu18.04 like so:  

 

swapoff -a 

- If you are using a firewall on your server make sure you allow port 6443 both UDP and TCP for Kubernates to work. 

ufw allow 6443/udp && ufw allow 6443/tcp

- Try again by kubectl get nodes if you have any nodes will appear if not, the outcome will be

NAME          STATUS     ROLES    AGE   VERSION

master-node   NotReady   <none>   13s   v1.17.0

 

 

 

 

 

 


Network
published
v.0.01



Jack said:

Thank you.

Posted On: January 01, 2020 14:28:57 PM
Phillip said:

Thank you for documenting the error, it was helpful.

Posted On: December 31, 2019 22:47:13 PM

For peering opportunity Autonomouse System Number: AS401345 Custom Software Development at ErnesTech Email AddressContact: [email protected]