Welcome to the Linux Foundation Forum!

Exercise 3.2: Grow the Cluster (7)

I am currently having trouble joining my worker node to my cluster.
I run the kubeadm join command, that was genereted from my master node by running "kubeadm token create --print-join-command" and running the output from my worker node as root, and get the following output.

[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/
error execution phase preflight: couldn't validate the identity of the API Server: Get "https://k8scp:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": dial tcp 172.31.46.126:6443: connect: connection refused
To see the stack trace of this error execute with --v=5 or higher

Any suggestions ?

Comments

  • Okay, so was using the alias in my join command instead of the IP.
    I ran it again with the IP and got the following output.

    [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/
    [preflight] Reading configuration from the cluster...
    [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
    error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Get "https://k8scp:6443/api/v1/namespaces/kube-system/configmaps/kubeadm-config?timeout=10s": dial tcp 172.31.46.126:6443: connect: connection refused
    To see the stack trace of this error execute with --v=5 or higher

    slowly getting there

  • It looks like I was able to fix it by restarting my master node.

  • @soramaru

    In this case, you need to change the driver from "cgroupfs" to "systemd". Please follow the below instructions.

    nano /etc/docker/daemon.json
    paste the below lines in daemon.json.

    {
    "exec-opts": ["native.cgroupdriver=systemd"]
    }

    Then

    sudo systemctl daemon-reload
    sudo systemctl restart docker
    sudo systemctl restart kubelet

    Then,

    sudo kubeadm reset
    sudo kubeadm init --config=kubeadm-config.yaml --upload-certs | tee kubeadm-init.out

    Then reset the worker nodes as well and join them by using the command which will be generated at the complete execution of kubeadm init ... command.

  • chrispokorni
    chrispokorni Posts: 2,155
    edited February 2022

    Hi @soramaru,

    The warning messages about the cgroup driver can be disregarded. However, I would be concerned about the "connection refused" error messages. Are both of your /etc/hosts files properly configured with the control-plane node private IP and its alias? Are your firewalls allowing all traffic from all sources, all protocols, to all ports?

    Regards,
    -Chris

  • @alihasanahmedk

    Thanks, that is actually good to know even if I do not use it here.

    @chrispokorni

    Yes on both

  • @chrispokorni
    It turns out the problem was in the /etc/hosts file.
    I was using the worker IP and not the cp IP.
    That's my fault.

    As I am going through this course, I am starting seeing all the dumb mistakes I'm making.
    Almost embarising to even mention.

    Anyways, thanks for the feedback.

Categories

Upcoming Training