Search code examples
kubernetesflannel

Modify internalip of node in kubernetes


I think I just need to modify the internal ip of a worker node to get it back because its static Ip had changed.

I tried without success:

kubectl patch node mynode -p '{"status": {"addresses": [{ "address": "44.33.22.11", "type": "InternalIP" }] } }'

node "mynode" not patched

What is the way to modify the worker internalip from master node and get it back ?

Thank you in advance for your help.


Solution

  • I found out the below way to update worker node IP address:

    1. Execute kubeadm reset on worker node.
    2. Change IP address using ifconfig <network interface> <IP address> command.
    3. Add node again using kubeadm join command.

    Note, if you added custom IP addresses for worker Nodes to /etc/hosts, don’t forget to change it there.