Weave Net 2.0 Released: Peer Discovery, Docker Swarm plugin & CLI changes
Today, we’re pleased to announce the release of Weave Net 2.0, which features a peer discovery feature via Weave Cloud, a Docker Swarm plugin, and several changes to Weave Net’s CLI and internals.
Today, we’re pleased to announce the release of Weave Net 2.0 with some exciting new features including peer discovery and an upgraded Docker Swarm plugin. The release of 2.0 is a major milestone for the project, it’s now a mature and powerful networking technology that’s used to connect thousands of systems.
We first announced Weave Net on Hacker News back in September 2014 as the original multi-host network to Docker. We’ve added a host of features since then, including making it simple to install on Kubernetes, a network policy controller that provides cloud-native security for microservices applications, and boosted the speed of encrypted networking. To give you an idea of the journey so far - we’ve made 48 releases, with 6100+ commits, closed 1300+ issues and merged 1100+ pull requests in the weaveworks/weave project.
Today, Weave Net is the leading overlay network and network policy add-on for Kubernetes. But, there’s a lot more to come as we continue to focus on Weave Net being the fastest and easiest way for developers to add an overlay network.
The key features in 2.0 are:
- a peer discovery feature via Weave Cloud
- an updated Docker Swarm plugin
- Weave Net’s CLI changes
Let’s take a look at each of these features more closely.
Weave Net Peer Discovery via Weave Cloud
Weave Net 2.0 now gives you the additional ability to connect all of your container hosts via Weave Cloud, using a more simple universal command.
In previous versions, the only way to tell Weave routers to connect to each other was to create startup scripts that listed (or discovered) the IPs of other hosts in your cluster. Now, by providing all of your clusters with a Weave Cloud Service Token, the cloud service will take care of telling each host about all of the others.
You can obtain a token by signing up to Weave Cloud and creating a new Instance:
Use the token you’ve just obtained to launch Weave Net, using the instructions on the same screen.
$ weave launch --token=<paste your token here>
You can see all the peers you have launched with this token in the ‘Connect’ display:
You may have a configuration where your machines have both internal and external IP addresses. In this case, control the addresses used for peer discovery using this command:
$ weave launch --advertise-address=172.16.0.3 --token=...
That’s it! Each peer will attempt to connect to all the other machines, using the IP addresses that it has found. Once they have formed a mesh network, you can connect up your containers to communicate across them.
Weave Network Plugin v2 for Docker Swarm
Another major feature introduced in the 2.0 release is Weave Network Plugin v2 for the Docker Engine managed plugin system. The Weave Network Plugin v2 enables Weave Net in Docker Swarm mode, so it can network Docker services and take advantage of Weave Net features, e.g. multicast networking.
To install the plugin from the Docker Store, run the following on all nodes participating in a Swarm cluster:
$ docker plugin install store/weaveworks/net-plugin:latest_release
Afterwards, you should be able to create a new network to be used by Docker services. See Integrating Docker via the Network Plugin (v2) and Weave Net page on the Docker Store for documentation and more details.
Weave Net’s CLI & internals changes
We have simplified the command-line interface and restructured the internals. This means much simpler coordination, less chance of race conditions, a reduced attack surface and better overall robustness.
- No more
When Weave Net was first released, it only provided one way to run a container on the weave network: weave run. This command always had limitations so we removed it in favor of:
eval "$(weave env)"; docker run … when you need to use Weave Net as a proxy to Docker
docker run --net=weave … when you need to use Weave Net as a Docker plugin
docker run …; weave attach … when you need to attach a container to Weave Net after it has started.
- No more weave
For the same reasons as for weave run, these commands have been removed.
- No more
weave launch-proxy, stop-proxy, launch-router, stop-router:
In Weave Net 2.0, the various processes forming Weave Net were merged into a single process.
As a result, the above commands no longer make sense and you should therefore now only use:
- weave launch now accepts all arguments previously accepted by
weave launch-router and
- you can disable unused components by passing:
--proxy=false --plugin=false --no-dns
We hope the new features and simplifications in Weave Net will provide you with a greater experience with container networking.
For further reading: