kubeadm join fails with connection refused on one node only

3/29/2018

I have a Kubernetes cluster with 1 master and 5 workers, when I try to join the 6th worker node, It gets this error:

$ sudo kubeadm join 172.22.20.20:6443 --token xxxxx.yyyyyyyy --discovery-token-ca-cert-hash sha256:zzzzzzz
[preflight] Running pre-flight checks.
    [WARNING FileExisting-crictl]: crictl not found in system path
Suggestion: go get github.com/kubernetes-incubator/cri-tools/cmd/crictl
[discovery] Trying to connect to API Server "172.22.20.20:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://172.22.20.20:6443"
[discovery] Failed to request cluster info, will try again: [Get https://172.22.20.20:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: dial tcp 172.22.20.20:6443: getsockopt: connection refused]

All worker nodes are built the exact same way (script) on Ubuntu Server 16.04.

Is there any limit for join? What kind of logs would be useful?

-- Gildas
join
kubeadm
kubernetes

2 Answers

4/25/2020

I had the same problem. In my case, I was using vagrant to set up a private network. When starting kubeadm, you must specify the host IP.

sudo kubeadm init --pod-network-cidr = 192.168.0.0 / 16 --apiserver-advertise-address = {Static_IP_ADRESS_HOST}

Example:

sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=172.16.94.10

the expected output will be something like enter image description here

I hope this helps.

-- Marcos Rufino
Source: StackOverflow

3/29/2018

No, there are no limits for joining to the cluster.

You got dial tcp 172.22.20.20:6443: getsockopt: connection refused, which means that your new node cannot connect to the Kubernetes API server which is working on master.

Try to check your network connection between a new node and a master by curl, as example - curl https://172.22.20.20:6443, I think you will get a similar error.

So, check and repair your network settings, it should help.

-- Anton Kostenko
Source: StackOverflow