Change the master IP address of a kubernetes cluster

5/28/2018

I am running a 3-node kubernetes cluster on VirtualBox. So far, I was running the master API server on a DHCP interface which always gets a fixed address from the router based on MAC-address mappings. Instead of that, I now want to use a private network for this purpose - I have setup a host-only network for this.

What is the right way to move my kubernetes cluster to this network. Should the following work?

  1. On the master:

    kubeadm reset
    kubeadm init --apiserver-advertise-address=<new-ip> --pod-network-cidr=<same-old-ip>
  2. On the workers:

    kubeadm join ... new credentials ...

Is there anything else I need to ensure?

-- CppNoob
docker
kubernetes

0 Answers