Add support for overlay networks in Swarm.

Built-in in docker >= 1.9, it justs need a K-V store.
This patch reuses the existing etcd supporting Swarm.

Change-Id: Iae2e5aa1d8836d344f16ec911c766c426b1b558a
This commit is contained in:
Mathieu Velten 2016-09-05 15:23:00 +02:00
parent 5476354e65
commit 7c0be2d384
2 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,13 @@
echo "Configuring ${NETWORK_DRIVER} network service ..."
if [ "$NETWORK_DRIVER" == "docker" ]; then
DOCKER_NETWORK_OPTIONS="--cluster-store etcd://$ETCD_SERVER_IP:2379\
--cluster-advertise $SWARM_NODE_IP:9379"
sed -i "/^DOCKER_NETWORK_OPTIONS=/ s#=.*#='$DOCKER_NETWORK_OPTIONS'#" \
/etc/sysconfig/docker-network
fi
if [ "$NETWORK_DRIVER" != "flannel" ]; then
exit 0
fi

View File

@ -0,0 +1,9 @@
---
features:
- Add configuration for overlay networks for the docker
network driver in swarm. To use this feature, users need
to create a swarm cluster with network_driver set to 'docker'.
After the cluster is created, users can create an overlay network
(docker network create -d overlay mynetwork) and use it when
launching a new container (docker run --net=mynetwork ...).