Docker: how to deal with restarted nodes?

If the virtual machine with the docking station is rebooted, for example, due to the azure correction of the VM or for some reason, the node can get a new IP address (VirtualBox can cause this and Azure too) This, in turn, leads to that the certificate is no longer valid and Docker does not start on this machine.

If I use Docker Swarm, the result is that the restarted node will be status dependent. Expected endlessly.

If I then do a docker-machine regenerate-certs mymachine, then it will start working again.

How can I talk about this? I think there is no way to restart nodes, so how do you handle this?

+4
source share
1 answer

As for Azure, you can make sure that your virtual machine maintains its public IP address after a reboot using the Reserved IPs addresses. Please note that using reserved IP addresses on Azure (as with other cloud providers) may incur additional costs. https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-reserved-public-ip/

Another way to handle this is to use discovery. Swarm offers a detection engine that supports etcd, consul, and zookeeper. See here for more details: https://docs.docker.com/swarm/discovery/

+3
source

Source: https://habr.com/ru/post/1629756/


All Articles