Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Joining cluster takes forever

I have set up my master node and I am trying to join a worker node as follows:

kubeadm join 192.168.30.1:6443 --token 3czfua.os565d6l3ggpagw7 --discovery-token-ca-cert-hash sha256:3a94ce61080c71d319dbfe3ce69b555027bfe20f4dbe21a9779fd902421b1a63

However the command hangs forever in the following state:

[preflight] Running pre-flight checks
    [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/

Since this is just a warning, why does it actually fails?

edit: I noticed the following in my /var/log/syslog

Mar 29 15:03:15 ubuntu-xenial kubelet[9626]: F0329 15:03:15.353432    9626 server.go:193] failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml", error: open /var/lib/kubelet/config.yaml: no such file or directory
Mar 29 15:03:15 ubuntu-xenial systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Mar 29 15:03:15 ubuntu-xenial systemd[1]: kubelet.service: Unit entered failed state.
like image 631
pkaramol Avatar asked Mar 29 '19 05:03

pkaramol


2 Answers

First if you want to see more detail when your worker joins to the master use:

kubeadm join 192.168.1.100:6443 --token m3jfbb.wq5m3pt0qo5g3bt9     --discovery-token-ca-cert-hash sha256:d075e5cc111ffd1b97510df9c517c122f1c7edf86b62909446042cc348ef1e0b --v=2

Using the above command I could see that my worker could not established connection with the master, so i just stoped the firewall:

systemctl stop firewalld 
like image 134
Christian Altamirano Ayala Avatar answered Nov 16 '22 01:11

Christian Altamirano Ayala


This can be solved by creating a new token using this command:

kubeadm token create --print-join-command

and use the token generated for joining other nodes to the cluster

like image 22
Aditya Chudiwal Avatar answered Nov 15 '22 23:11

Aditya Chudiwal