Broken cluster

I am trying to build new cluster using kubeadm and Hardway as well. Most of the times I experience below error after installing all cluster components.

command: kubectl cluster-info
result: the connection to the server :6443 was refused - did you specify the right host or port?

Is there any order that i need to follow to debug this issue or randomly verify all the components. I have never been succeed in resolving this issue. Can you please assist me on this.

You might want to run kubeadm with -v to get verbose output from the logs. A first guess without more information is that the firewall is blocking it.

1 Like

Here’s a link the same issue. The commnads below fixed the issue.

sudo -i
swapoff -a
strace -eopenat kubectl version

and you can type kubectl get nodes again.

Hey folks,

First of all your kubeadm init finished well? Did you copy the admin configuration for your $HOME/.kube/config?

yes I have done that, and kubectl config view show right config file.

Hey Raj,

Nice! Did you try connect in localhost port 6443? Is there 6443 port for kube-apiserver open? Which test did you make? I’d like to help you to solve that.