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:
- 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