How to make kubernetes work with dynamic ip address How to make kubernetes work with dynamic ip address kubernetes kubernetes

How to make kubernetes work with dynamic ip address


As @Suresh Vishnoi mentioned, it is not possible to set a DNS name in current stable versions of Kubernetes because of implementation.

But, merge request with that feature - new key for DNS name instead of IP address are already merged into Kubernetes master and available from version v1.10.0-beta.4.

In your case, it is not possible to use DNS name for discovery, but, you can set up your DHCP server for associate IP address from DHCP pool to MAC address of your master, which will able you to using all features of DHCP, but an address of your master will be always same.

Standard Linux dhcpd DHCP server you can configure like that (replace a mac address and IP to which one you need):

host KubeMaster { hardware ethernet 00:1F:6A:21:71:3F; fixed-address 10.0.0.101;}

If you using any router or different OS for your DHCP server, then please check their documentation.