Failed to join nodes to your Kubernetes cluster

I used the ubuntu multi-node play-ground, and i created a kub cluster in each one of them, but when i tried to join the worker nodes tothe master node, this error rises :

error execution phase preflight: couldn’t validate the identity of the API Server: Get “https://172.25.0.77:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s”: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
To see the stack trace of this error execute with --v=5 or higher

for the kubernetes version :
root@node01:~# kubectl version
Client Version: version.Info{Major:“1”, Minor:“20”, GitVersion:“v1.20.0”, GitCommit:“af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38”, GitTreeState:“clean”, BuildDate:“2020-12-08T17:59:43Z”, GoVersion:“go1.15.5”, Compiler:“gc”, Platform:“linux/amd64”}
Error from server (NotFound): the server could not find the requested resource

I tried to do the same thing multiple times, even starting a new playground, but without success.
what should i do to solve this problem?

Best regards,

Hi @ghemarimahmoud17,
Please check your inbox. I have mailed you the steps. I didn’t see any issues with the playground.



Regards,

The problem was with the IP address of the master node, i used the eth1 ip@ instead of the eth0 ip@ when initiating it.
kubeadm init --apiserver-cert-extra-sans=controlplane --apiserver-advertise-address < masterNode eth0 Ip@ > --pod-network-cidr=10.244.0.0/16

1 Like

Glad, it worked for you. :+1: :+1:

Hi
I’m getting the same error now. I have used the apiserver address of master eth0.
What could be the other reasons for this error.
Anyone, please help me…

hi Sir/madam, I have similar issue. I thought its the firewall ports that was blocking. Anyhow

I created a 1.28 cluster however, unable to join the node. Please find cluster info network info and the logs from node02 where join command issues. PLease help me and give me some directions on how to get this resolved.

bob@node01 ~ ➜  kubectl cluster-info
Kubernetes control plane is running at https://172.25.0.49:6443
CoreDNS is running at https://172.25.0.49:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

bob@node01 ~ ➜  ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: datapath: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 0a:73:35:9c:e3:23 brd ff:ff:ff:ff:ff:ff
4: weave: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue state UP group default qlen 1000
    link/ether 0e:f9:b4:7c:08:f5 brd ff:ff:ff:ff:ff:ff
    inet 10.32.0.1/12 brd 10.47.255.255 scope global weave
       valid_lft forever preferred_lft forever
6: vethwe-datapath@vethwe-bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue master datapath state UP group default 
    link/ether 9e:ee:fa:a7:c0:11 brd ff:ff:ff:ff:ff:ff
7: vethwe-bridge@vethwe-datapath: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue master weave state UP group default 
    link/ether 6a:86:fe:cd:45:1d brd ff:ff:ff:ff:ff:ff
8: vxlan-6784: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65535 qdisc noqueue master datapath state UNKNOWN group default qlen 1000
    link/ether ee:a1:8d:4f:2c:58 brd ff:ff:ff:ff:ff:ff
10: vethwepl1667dab@if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue master weave state UP group default 
    link/ether 36:5e:55:58:74:a1 brd ff:ff:ff:ff:ff:ff link-netns cni-1eb2894e-bf33-5d08-8fe9-3ae16afa5bfe
12: vethwepl6169036@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue master weave state UP group default 
    link/ether ee:e7:d2:2e:bb:f0 brd ff:ff:ff:ff:ff:ff link-netns cni-f159d3ac-df0d-554f-68ad-218fb0e9b9d8
2085: eth0@if2086: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default 
    link/ether 02:42:c0:29:df:08 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.41.223.8/24 brd 192.41.223.255 scope global eth0
       valid_lft forever preferred_lft forever
2087: eth1@if2088: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:ac:19:00:31 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet 172.25.0.49/24 brd 172.25.0.255 scope global eth1
       valid_lft forever preferred_lft forever

bob@node02 ~ ✖ sudo kubeadm join 172.25.0.49:6443 --token cnbkvy.xwgovo6tk6z902j8 --discovery-token-ca-cert-hash sha256:70eaabd781b50a90b238c346bb29640485abf43cc02c03c21b822f2d88d779f7 --v=5
I1001 19:00:00.601827   25062 join.go:412] [preflight] found NodeName empty; using OS hostname as NodeName
I1001 19:00:00.602109   25062 initconfiguration.go:117] detected and using CRI socket: unix:///var/run/containerd/containerd.sock
[preflight] Running pre-flight checks
I1001 19:00:00.602221   25062 preflight.go:93] [preflight] Running general checks
I1001 19:00:00.602305   25062 checks.go:280] validating the existence of file /etc/kubernetes/kubelet.conf
I1001 19:00:00.602326   25062 checks.go:280] validating the existence of file /etc/kubernetes/bootstrap-kubelet.conf
I1001 19:00:00.602343   25062 checks.go:104] validating the container runtime
I1001 19:00:00.629490   25062 checks.go:639] validating whether swap is enabled or not
I1001 19:00:00.630018   25062 checks.go:370] validating the presence of executable crictl
I1001 19:00:00.630070   25062 checks.go:370] validating the presence of executable conntrack
I1001 19:00:00.630098   25062 checks.go:370] validating the presence of executable ip
I1001 19:00:00.630131   25062 checks.go:370] validating the presence of executable iptables
I1001 19:00:00.630166   25062 checks.go:370] validating the presence of executable mount
I1001 19:00:00.630189   25062 checks.go:370] validating the presence of executable nsenter
I1001 19:00:00.630216   25062 checks.go:370] validating the presence of executable ebtables
I1001 19:00:00.630246   25062 checks.go:370] validating the presence of executable ethtool
I1001 19:00:00.630267   25062 checks.go:370] validating the presence of executable socat
I1001 19:00:00.630292   25062 checks.go:370] validating the presence of executable tc
I1001 19:00:00.630313   25062 checks.go:370] validating the presence of executable touch
I1001 19:00:00.630338   25062 checks.go:516] running all checks
I1001 19:00:00.643820   25062 checks.go:401] checking whether the given node name is valid and reachable using net.LookupHost
I1001 19:00:00.644014   25062 checks.go:605] validating kubelet version
I1001 19:00:00.707203   25062 checks.go:130] validating if the "kubelet" service is enabled and active
I1001 19:00:00.739593   25062 checks.go:203] validating availability of port 10250
I1001 19:00:00.740526   25062 checks.go:280] validating the existence of file /etc/kubernetes/pki/ca.crt
I1001 19:00:00.740564   25062 checks.go:430] validating if the connectivity type is via proxy or direct
I1001 19:00:00.740613   25062 checks.go:329] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I1001 19:00:00.749949   25062 checks.go:329] validating the contents of file /proc/sys/net/ipv4/ip_forward
I1001 19:00:00.750456   25062 join.go:529] [preflight] Discovering cluster-info
I1001 19:00:00.750507   25062 token.go:80] [discovery] Created cluster-info discovery client, requesting info from "172.25.0.49:6443"
I1001 19:00:10.757609   25062 token.go:217] [discovery] Failed to request cluster-info, will try again: Get "https://172.25.0.49:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

dear Sir/Madam,

Additionally pls find the fw ports status still not able to ping or access the cluster.If not this time the window closes as its 1hr even with extended. Its impossible to have everything working in given time. KIndly help me as soon as you can

sincerely
Suriya M

Master:
bob@node01 ~ ➜  sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
6443                       ALLOW       Anywhere                  
1                          ALLOW       Anywhere                  
21                         ALLOW       Anywhere                  
Anywhere                   ALLOW       172.25.0.0/24             
Anywhere                   ALLOW       192.41.0.0/24             
443                        ALLOW       Anywhere                  
172.25.0.0/24              ALLOW       Anywhere                  
56                         ALLOW       Anywhere                  
192.41.0.0/24              ALLOW       172.25.0.0/24             
172.25.0.0/24              ALLOW       192.41.0.0/24             
6443 (v6)                  ALLOW       Anywhere (v6)             
1 (v6)                     ALLOW       Anywhere (v6)             
21 (v6)                    ALLOW       Anywhere (v6)             
443 (v6)                   ALLOW       Anywhere (v6)             
56 (v6)                    ALLOW       Anywhere (v6)    


Node02:
=======
bob@node02 ~ ➜  ping 172.25.0.49                                                                        PING 172.25.0.49 (172.25.0.49) 56(84) bytes of data.
^C
--- 172.25.0.49 ping statistics ---
21 packets transmitted, 0 received, 100% packet loss, time 20464ms


bob@node02 ~ ✖ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2089: eth0@if2090: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default 
    link/ether 02:42:c0:29:df:0a brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.41.223.10/24 brd 192.41.223.255 scope global eth0
       valid_lft forever preferred_lft forever
2091: eth1@if2092: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:ac:19:00:32 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet 172.25.0.50/24 brd 172.25.0.255 scope global eth1
       valid_lft forever preferred_lft forever

bob@node02 ~ ➜  sudo ufw allow from 172.25.0.0/24 to any
Rule added

bob@node02 ~ ➜  sudo ufw allow from 172.25.0^C/24 to any

bob@node02 ~ ✖ ping 172.25.0.49
PING 172.25.0.49 (172.25.0.49) 56(84) bytes of data.
^C
--- 172.25.0.49 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2050ms


bob@node02 ~ ✖ sudo ufw allow from 192.41.0.0/24 to any
Rule added