Roger Johansson
Roger Johansson

Reputation: 23224

Docker: How to deal with restarted nodes?

If a docker enabled VM is restarted, e.g. due to Azure patching the VM or for whatever reason, the node can get a new IP address (VirtualBox can cause this, and Azure too) Which in turn results in the cert no longer being valid and Docker fails to start on that machine.

If I use Docker Swarm, the result is that the restarted node will be stuck in status Pending indefinitely.

If I then do a docker-machine regenerate-certs mymachine then it starts working again.

How should I reason around this? I guess there is no way around having nodes being restarted, so how do you deal with this?

Upvotes: 4

Views: 150

Answers (1)

Ori Zohar
Ori Zohar

Reputation: 126

Regarding Azure you can ensure your VM keeps its public IP address after restart by using "Reserved IP" addresses. Please note using reserved IPs on Azure (as with other cloud providers) may incur additional charges. https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-reserved-public-ip/

Another way to handle this is using discovery. Swarm offers a discovery mechanism which support etcd, consul and zookeeper. Find more details here: https://docs.docker.com/swarm/discovery/

Upvotes: 3

Related Questions