1

I installed a kubernetes cluster by using kuberspray on my internal network, 192.168.0.0/24. Now I need more nodes and these nodes will be located on other networks. So I will set up a VPN between the current nodes and the new nodes.

The problem is that I cannot find any information specifically related to kubespray on how to change the internal IPs of the nodes in order to "move them on the VPN". I think after moving the nodes on the VPN, then it's just a matter of installing the new nodes in the cluster and I'm set.

So: Using kubespray (or manually if not possible via kubespray directly) how can I change the internal IPs of the nodes in order to move them on the VPN?

Paul
  • 20,883
  • 7
  • 57
  • 74

1 Answers1

0

Kubespray supports kubeadm for cluster creation since v2.3 and deprecated non-kubeadm deployment starting from v2.8. I assume that you can use kubeadm with your Kubespray installation. I see two ways to achieve your goal. Both from Kubernetes side:

  1. By using ifconfig command:

    • run kubeadm reset on the node you want to reconfig

    • run ifconfig <network interface> <IP address>

    • run kubeadm join in order to add the node again with the new IP

  2. By editing the kubelet.conf file:

    • run systemctl status kubelet to find out the location of your kubelet.conf (usually /etc/kubernetes/kubelet.conf)

    • edit it by adding KUBELET_EXTRA_ARGS=--node-ip=<IP_ADDRESS>

    • run systemctl daemon-reload

    • run systemctl restart kubelet

Please let me know if that helped.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
  • no unfortunately not. If I edit `/etc/kubernetes/kubelet.env` (the equivalent of the conf file you mention) and set `--node-ip` on a worker node then reload and restart kubelet nothing happens when I `kubectl get nodes -o wide`. I also tried a variation of https://github.com/kubernetes/kubeadm/issues/338#issuecomment-418879755 to no avail. – Paul May 15 '20 at 08:11