简体   繁体   English

在没有停机的情况下更新群集群集中的docker network

[英]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. Out网络在compose文件中使用默认设置定义,过了一段时间我们意识到它创建了子网10.0.2.0/24的覆盖网络。 Eventually we started to run out of IPs. 最终我们开始耗尽IP。

Now we would like to change subnet to something like /20. 现在我们想将子网改为/ 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 ? 这样做还有其他方法吗?

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. 您可以手动创建新网络,将其连接到具有别名的所有容器,然后断开旧网络与所有容器的连接并将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM