How to handle IP change?


I’m using vagrant with “public_network” networking a lot to test my native Replicated app. That means the public IP address of the virtualmachine changes after I save and resume it. Replicated doesn’t like that at all and pretty much everything stops working in strange ways. I didn’t find a way yet to keep it running as it was, I always have to uninstall Replicated completely and start from scratch.

Any advice on how to handle the IP change on the instance?


You can update the PRIVATE_ADDRESS, DAEMON_HOST, and PUBLIC_ADDRESS parameters in /etc/default/replicated and /etc/default/replicated-operator. Then you can run systemctl restart replicated replicated-operator to pick up the changes.

One update – On systemd based systems (which includes RHEL, CentOS, and later versions of Ubuntu among others), these files will exist in /etc/sysconfig/replicated and /etc/sysconfig/replicated-operator instead of under /etc/default.

For swarm, services need to be modified with docker commands

docker service update replicated_replicated --env-add LOCAL_ADDRESS=<private ip>
docker service update replicated_replicated --env-add SWARM_INGRESS_ADDRESS=<public ip>
docker service update replicated_replicated-operator --env-add DAEMON_REGISTRY_ENDPOINT=<private ip>

Also note that in airgapped installs, the value for public IP should be the same as private IP