1
votes

I have two server to work as master and work node on local server network.

*master node
  10.20.20.214
worker node
  10.20.20.218*

In master node, I success using kubeadm init to setup with Calico network. It report message code for me to join other node

kubeadm join 10.20.20.214:6443 --token sy32dd.gzs4q4vi91p2o87f \
    --discovery-token-ca-cert-hash sha256:9f2eb4dc6fbc549792adada262b8aff65dd547fa9aac0890e64604df6cd31e11

But when I try to using this code to join work node, it seems cannot access to this ip port 10.20.20.214:6443, and report error message below.

I0804 16:49:45.848694  111847 token.go:215] [discovery] Failed to request cluster-info, will try again: Get https://10.20.20.214:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s: dial tcp 10.20.20.214:6443: connect: no route to host
2
Questions about configuring clusters should be asked on serverfault.com - Tarun Khosla
"no route to host" has nothing to do with ports. Have you been checking your network? Routing, etc? What troubleshooting has already been done? How exactly you are setting up a cluster? - Nick

2 Answers

1
votes

The reason display on error output, no route to host 10.20.20.214. You have network connectivity problem.
Try telnet to 10.20.20.214 on port 6443. worker node should have access kube-api-server component on master node on port 6443.
Check this link to undrestand kubernetes use which ports.
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/

0
votes

Usually the: dial tcp <master-ip>:6443: connect: no route to host error is caused because master node ingress rules blocks port 6443.

If your network is private and reliable - setup the ingress rule below:

 sudo firewall-cmd --zone=<public/or-other-zone> --add-port=6443/tcp --permanent
 sudo firewall-cmd --reload
 sudo firewall-cmd --list-all

(*) I'll assume you're running kubeadm on-prem. If you're running on cloud infra - use the relevant firewall setup.