Home > Articles > Details

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?


Please Login to see the rest of the answer
Answer: 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

 

 

 

 

 

 


If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

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

© 2022 - ErnesTech - Privacy