Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update docker network in a swarm cluster without downtime

Out networks are defined in compose file with default settings and after a while we realized that it creates overlay network with subnet 10.0.2.0/24. Eventually we started to run out of IPs.

Now we would like to change subnet to something like /20. I suppose we need to create new network and attach it to every container, but that would require to recreate every container and that will cause downtime.

Is there any other approach for doing this ?

like image 798
Anton Avatar asked Aug 31 '25 20:08

Anton


1 Answers

We have found a workaround. You can manually create the new network, connect it to all containers with aliases, and then disconnect old network from all containers and remove it.

like image 82
Anton Avatar answered Sep 03 '25 18:09

Anton