kubeadm Uses the Hostname as the Node Name, So Name a Node Before It Joins

In progress Kubernetes Linux

When kubeadm init or kubeadm join runs, the node registers under its hostname unless --node-name says otherwise. The name is then built into the node's identity: the Node object, and the kubelet's client certificate, issued for system:node:<name>. Changing the hostname afterwards doesn't rename the node; it makes the kubelet's identity disagree with the machine.

Renaming a joined node means removing it and joining it again: drain it, kubectl delete node <old>, kubeadm reset on the machine, set the new hostname, then join. So the name is worth deciding before the first join.

Role-Based or Neutral Names

Scheme Example Strength Weakness
Role in the name k8s-cp-01, k8s-gpu-01 The role is readable at a glance. Wrong as soon as the role moves, which is exactly what a rebuild does.
Neutral name k8s-01 … k8s-05 Never goes stale. The role is invisible without labels.

Either way, the role should live in metadata that can change without a rejoin: Ansible inventory groups, node labels (kubectl label node … --overwrite) and taints for nodes that must accept only some workloads.

References