1

I provisioned a kubernetes cluster on my own couple of virtual machines via kubespray.
The VM's network is bridged adapter and kubespray uses calico as default network-plugin.

Before sometime, I've switched to another network and as a result of the router change, the internal IP addresses have been changed.

When I run kubectl get nodes on the master node I get -
Unable to connect to server : dial tcp <master previous IP>:6443: connect: network is unreachable
In addition, the vm doesn't generate a new ip for the machine (- from the current router.).

My question is, How can I change the ip's of the nodes ?

Attached is the screenshot of my laptop that shows the k8s nodes and the column I wish to edit.
(- The screenshot is fro when I've been connected to the network via the previous router.)

enter image description here

Thanks in advance for any help !

  • If I understood correctly, you want to change the node IP. This column display the nodes IPs, so you need to change the IP in your OS and re-join the nodes again, because Kubernetes doesn't manage this IPs. Could you confirm if I understood correctly, and if not give more details about or issue? – KoopaKiller Mar 16 at 8:36
  • No. I shutdown all the servers and now I have new ip's (- even for the master itself.). And the master dosn't success even to show the nodes. As, it tell me that it tries to connect to the previous master ip. – Sara Ben Shabbat Mar 16 at 16:23
  • To use a Kubernets cluster you need first of all configure your nodes with static IP, and them make the k8s installation. Do you performed this steps before install the cluster? – KoopaKiller Mar 17 at 8:11
  • No. So, As I understand the only one option is to reinstall ?! – Sara Ben Shabbat Mar 17 at 17:01
0

The collumn INTERNAL-IP show your nodes IPs, Kubernetes doesn't manage this IP's.

Is recommended configure static IP for all your nodes before setup your Kubernetes cluster to avoid problems like this.

I see 2 alternatives:

  1. Set static ip displayed in INTERNAL-IP on your nodes, for examples:

Your kubectl get nodes show node2 with ip 192.168.43.118, so in node2 you need to configure this ip and reboot the node. The same step for all nodes.

How to configure static ip on Ubuntu

How to configure static ip on CentOS

  1. Edit the --node-ip in kubelet config on the node for the new IP, see this reference.

References:

https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.