Welcome to the Linux Foundation Forum!

Lab:3.1 Initialize the master [kubeadm init] has failed with timed out waiting for the condition

anil.bmam Posts: 6
edited July 2021 in LFS258 Class Forum

Hi Team,

i am stuck at installing kubernetes at Lab: 3. 1 from step no: 15 , Initial the master. Below is the error details.
Please help me on this and provide your suggestions ?

COMMAND: kubeadm init --config=kubeadm-config.yaml --upload-certs \
| tee kubeadm-init.out # Save output for future review


Unfortunately, an error has occurred:
timed out waiting for the condition

    This error is likely caused by:
            - The kubelet is not running
            - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

    If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
            - 'systemctl status kubelet'
            - 'journalctl -xeu kubelet'

    Additionally, a control plane component may have crashed or exited when started by the container runtime.
    To troubleshoot, list all containers using your preferred container runtimes CLI.

    Here is one example how you may list all Kubernetes containers running in docker:
            - 'docker ps -a | grep kube | grep -v pause'
            Once you have found the failing container, you can inspect its logs with:
            - 'docker logs CONTAINERID'


  • serewicz
    serewicz Posts: 1,000


    Please run the command without the backslash which is for line continuation in Linux, and to make the command fit on the page.

    If it still errors check that you completed the previous steps properly. What are you using for your lab environment? Did you follow the setup suggestions?

    If you still have an error then seeing the full command and output would be necessary to further troubleshoot the issue.

  • anil.bmam
    anil.bmam Posts: 6
    edited July 2021

    Hi @serewicz ,

    Thank you for reading my query and helping the resolution...

    I am using GCP , compute engine instance Ubuntu 18 and ran below commands step by step that has suggested in Lab exercise document.

    I ran exactly same as below, can you pls have a look and help me what went wrong.
    also, pls help me how do i undo step 13 and run the command again if previous steps 1 - 12 was correct.

    1) sudo -i
    2) apt-get update && apt-get upgrade -y
    3) apt-get install -y vim
    4) apt-get install -y docker.io
    5) vim /etc/apt/sources.list.d/kubernetes.list , adding below line
    deb http://apt.kubernetes.io/ kubernetes-xenial main
    6) curl -s \https://packages.cloud.google.com/apt/doc/apt-key.gpg \ | apt-key add -
    7) apt-get update

    8) apt-get install -y \kubeadm=1.19.1-00 kubelet=1.19.1-00 kubectl=1.19.1-00
    9) apt-mark hold kubelet kubeadm kubectl

    10) wget https://docs.projectcalico.org/manifests/calico.yaml

    below lines are commented by default in calico.yaml ,so uncommented below lines in calico.yaml 
       value: ""

    11) vim /etc/hosts k8master

    12) creating vim kubeadm-config.yaml at root level and added below yaml stuff

    apiVersion: kubeadm.k8s.io/v1beta2
    kind: ClusterConfiguration
    kubernetesVersion: 1.19.1
    controlPlaneEndpoint: "k8smaster:6443"

    13) kubeadm init --config=kubeadm-config.yaml --upload-certs \ | tee kubeadm-init.out # Save output for future review

  • serewicz
    serewicz Posts: 1,000


    So far the commands look accurate, except for including the backslashes in the commands.

    There is a kubeadm reset command, but it does not fully undo everything the kubeadm init puts in place. As you are using GCE it would be easy to delete and recreate the two instances.


  • anil.bmam
    anil.bmam Posts: 6

    Hi @serewicz,

    I am able to install Kubernetes cluster successfully and i don't see subjected issue after I ran the command without the backslash.

    Thank you so much for providing guidance and appreciate your valuable response.

    Anil Kumar


Upcoming Training