Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change name of a kubernetes node

Tags:

kubernetes

I have a running node in a kubernetes cluster. Is there a way I can change its name?

I have tried to

  1. delete the node using kubectl delete
  2. change the name in the node's manifest
  3. add the node back.

But the node won't start.

Anyone know how it should be done?

Thanks

like image 653
Abelard Chow Avatar asked Sep 01 '17 19:09

Abelard Chow


People also ask

How do I rename my Kubernetes cluster name?

No, you cannot change a name of running cluster, because it serves for discovery inside a cluster and this would require near-simultaneous changing it across the cluster. Sadly, you also cannot change a name of the cluster before init .

How do I change the master node in Kubernetes?

If you want to change master IP address in kubeadm config, check following references: replacing the IP address in all config files in /etc/kubernetes. backing up /etc/kubernetes/pki. identifying certs in /etc/kubernetes/pki that have the old IP address as an alt name.

How do I change labels on Kubernetes?

You can change the labels on individual pods using the kubectl label command, documented here. Changing the label of a running pod should not cause it to be restarted, and services will automatically detect and handle label changes.


1 Answers

Usualy it's kubelet that is responsible for registering the node under particular name, so you should make changes to your nodes kubelet configuration and then it should pop up as new node.

like image 164
Radek 'Goblin' Pieczonka Avatar answered Oct 11 '22 06:10

Radek 'Goblin' Pieczonka