I have created a kubernetes cluster where I have a master node and two worker nodes. I initialised master node using below command
sudo kubeadm init --token-ttl=0 --apiserver-advertise-address=192.168.0.27
192.168.0.27
is the ip address of master node. Then I used the generated token to start my worker nodes. Now the problem is that my network is in DHCP and the ip address changes sometime due to which it starts showing below error:
Unable to connect to the server: dial tcp 192.168.0.27:6443: getsockopt: no route to host
It shows above error because at the time of initializing the master node, I have used the ip address and after the ip address changes, its not able to access it.
Is it possible to configure master and other nodes in some way so that they can work regardless of any ip address change.
Thanks