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
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
Thank you.
Thank you for documenting the error, it was helpful.