kubeadm Uses the Hostname as the Node Name, So Name a Node Before It Joins
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
- Kubernetes MOC - hub for Kubernetes notes.
- A Highly Available Control Plane Needs a Virtual IP That No Single Node Owns - why clients should target a VIP, not a node's name or IP.
- Workloads on the Only Control Plane Can Starve etcd, So Heavy Nodes Should Be Workers - the role change that forced the rename.
- Bootstrap a kubeadm Control Plane and Join Workers - init and join.
- Kubernetes documentation: kubeadm join -
--node-name. - Kubernetes documentation: Nodes - node names and self-registration.