Welcome to the Linux Foundation Forum!

LFS 258 - Lab 3.3 - Exercise 1 - Node' name

Options

The name of my nodes are IP Address. Did I do something wrong? Is it possible to change it to cp and worker?

ubuntu@ip-172-31-54-32:~$ kubectl get node
NAME STATUS ROLES AGE VERSION
ip-172-31-49-16 Ready 4h9m v1.27.1
ip-172-31-54-32 Ready control-plane 5d23h v1.27.1

Answers

  • marc.moline
    Options

    Hello @jordanofried,

    I think the node name is the same of hostname. I think you didn't change the hostname before the installation.

    Regards

  • fazlur.khan
    Options

    There is no command to rename the node name...

    If you want to change the names then you will have to delete the node, reset the cluster and bootsrap again and join the worker nodes

    1. kubeadm reset
    2. follow the instruction from the reset output to clean up .kube config file
    3. hostnamectl set-hostname
  • dcruzd
    dcruzd Posts: 2
    Options

    Alternatively to changing the hostname (some cloud providers may be picky about it), you can pass the argument --node-name [name you want] to both kubeadm init/kubeadm join to set a custom node name.

  • chrispokorni
    chrispokorni Posts: 2,190
    Options

    Hi @jordanofried,

    The EC2 hostname is derived from the instance private IP address, and this should not cause any issues with the lab exercises.

    Regards,
    -Chris

Categories

Upcoming Training