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

 

 

 

 

 

 

Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback

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

Jack said:

Thank you.

Phillip said:

Thank you for documenting the error, it was helpful.

Your Session is Ending
Login to Continue


© 2021 - ErnesTech - Privacy