I want to modify k8s node name

1/31/2019

I need to modify VM's hostname. VMs are configured by kubernetes.(Master2,worker 3)

Should I reconfigure the kubeadm ? Could you know how to change the VM's hostname ?

VM's OS is CentOS 7.4.

-- canerbis
kubernetes
master

1 Answer

1/31/2019

Can i ask you, why you want to modify name? in kubernets , labels serve as identifying attribute. You can add new labels to nodes with below command:

kubectl label <NODE_NAME> short_name=worker1

So every use case can be satisfied with label.

-- Rajesh Deshpande
Source: StackOverflow