Welcome to the Linux Foundation Forum!

In Lab 3.1, should `kubeadm init` use a different `--node-name`?

andrewjanssen
andrewjanssen Posts: 1
edited December 14 in LFS258 Class Forum

The lab manual says to use --node-name=cp but when I do this the cluster doesn't come up and kubeadm init fails. If I use --node-name=k8scp, the cluster is created successfully. Should I use k8scp? Are the lab instructions incorrect?

Answers

  • chrispokorni
    chrispokorni Posts: 2,372

    Hi @andrewjanssen,

    While the instruction from the lab guide is correct with the --node-name=cp option, on some infrastructure services an explicit entry is required in the hosts file with the private IP of the cp-node and cp, in addition to the entry with the private IP of the cp-node and the k8scp alias. Yes, this is somewhat redundant, but it helps to get through the lab exercises and it will simplify the configuration changes required later in lab 16. So my hosts file on the cp-node eventually looks like this:

    ...
    10.128.0.5 k8scp
    10.128.0.5 cp
    

    I also recommend editing the worker-node hosts file with the k8scp alias, cp entry and worker entry:

    ...
    10.128.0.5 k8scp
    10.128.0.5 cp
    10.128.0.7 worker
    

    Regards
    -Chris

Categories

Upcoming Training