Bryan Boreham
334974472d
Rename router.Bridge to router.InjectorConsumer
...
since what it does it injects and consumes packets, and something else
entirely does bridging.
2017-04-25 11:03:32 +01:00
Bryan Boreham
a731d47d97
Rename bridge detection/creation functions
2017-04-24 16:42:05 +00:00
Bryan Boreham
9fd1a43769
Put back some weave bridge options
...
ability to set MTU was lost in an earlier change
2017-04-24 14:55:53 +00:00
Bryan Boreham
108f4784a6
Add back check for datapath supported
2017-04-20 16:12:42 +00:00
Bryan Boreham
a7feb41e62
Replace switch statements with Bridge polymorphism
2017-04-20 15:57:49 +00:00
Bryan Boreham
fddb3ee06e
Review feedback
2017-04-20 15:57:49 +00:00
Bryan Boreham
3574da267b
Remove -enforce_docker_bridge_addr_assign_type no longer used
2017-04-17 19:41:47 +00:00
Bryan Boreham
ae625a18c8
Move awsvpc bridge expose from weave script to Go code
2017-04-17 19:41:47 +00:00
Bryan Boreham
4ad1c22ef6
Move initial DNS population into Go code
2017-04-17 19:41:47 +00:00
Bryan Boreham
ef9f95f653
Let weaver create the bridge in weave-kube
2017-04-17 19:41:47 +00:00
Bryan Boreham
3b54372eab
Let weaver create the bridge in net-plugin launch
2017-04-17 19:41:47 +00:00
Bryan Boreham
f05bb6c4e0
Don't assume we always run in in host pid space
...
Pass the path to the proc filesystem down
2017-04-17 19:41:47 +00:00
Bryan Boreham
c3a41286fd
Use the bridge name passed in on the command-line more
2017-04-17 19:41:47 +00:00
Bryan Boreham
8297652204
Read our peerName from persistence file if necessary
...
Mount directories for machine ID files into weave container
2017-04-17 19:41:47 +00:00
Bryan Boreham
a26fc67ded
New way of initializing; remove --iface option
2017-04-17 19:41:47 +00:00
Bryan Boreham
abadbf883a
AWSVPC mode now part of BridgeConfig
2017-04-17 19:41:47 +00:00
Bryan Boreham
e7e3608642
Move creation of bridge inside router
2017-04-17 19:41:47 +00:00
Bryan Boreham
dd232775e6
Move expect-npc setup from weave script to Go code
2017-04-17 19:41:47 +00:00
Bryan Boreham
a8eb7966b6
Wire up enforce_docker_bridge_addr_assign_type
2017-04-17 19:41:47 +00:00
Bryan Boreham
8051f51d46
Move bridge-creation code from weave script into Go code
...
via weaveutil create-bridge function
2017-04-17 19:41:47 +00:00
Bryan Boreham
986a3f8079
Pass bridge name into awsvpc
2017-04-17 19:41:47 +00:00
Marc CARRE
7c5dda353d
Only list active containers.
...
Previously was using `docker.ListContainersOptions{All: true}`, which is the equivalent of `docker ps -a`, and is not what we want here.
2017-04-13 12:12:49 +01:00
Marc Carré
8961041469
Merge pull request #2727 from weaveworks/issues/2397-v2-plugin
...
Create a V2 Docker plugin
2017-04-12 14:27:34 +01:00
Martynas Pumputis
1a3537a8f4
Replace noDNS by dns in plugin
...
Just to avoid double negation.
2017-04-12 13:05:40 +00:00
Martynas Pumputis
09606db9c3
Exit when launching plugin-v2 if node is not active in Swarm
...
We retrieve the list of swarm masters for peer discovery when launching
plugin-v2, thus the node should belong to any Swarm when enabling the
plugin.
2017-04-12 13:05:40 +00:00
Martynas Pumputis
4a708c2a82
Rename prog/plugin-v2 to prog/net-plugin
...
Consensus was to call the plugin-v2 as weaveworks/net-plugin.
2017-04-12 13:05:40 +00:00
Martynas Pumputis
01bfa602ad
Pass noDNS and isPluginV2 flags to plugin
...
- "noDNS" controls whether upon ContainerStarted event a container
should be registered within the Weave DNS.
- "isPluginV2" will be used to determine a path to host's /proc.
2017-04-12 13:05:40 +00:00
Martynas Pumputis
332762201a
Reuse docker client instance in plugin
...
Instead of creating a new one, reuse one created in weaver.
The change removes the pinning of client API versions (1.21 in our
case).
2017-04-12 13:05:40 +00:00
Martynas Pumputis
568290afb7
Do not start local scope plugin (mesh) in plugin-v2
...
Currently, plugin-v2 works only in "swarm" scope, as it depends
on swarm for peer discovery.
2017-04-12 13:05:40 +00:00
Martynas Pumputis
3c11c8aa38
Add comment about failures to is-docker-plugin-enabled cmd
2017-04-12 13:05:40 +00:00
Martynas Pumputis
0ff37d3492
Do "docker plugin inspect" inside weaveutil
...
We cannot do it from weaveexec, because the latter is distributed
with an old version of Docker client which does not support
Plugins API.
2017-04-12 13:05:40 +00:00
Martynas Pumputis
d7306c66f7
Get rid of deprecated --no-multicast-route
2017-04-12 13:05:40 +00:00
Martynas Pumputis
1f42a9d2f9
Merge plugin into weaver
...
This simplifies the following:
- plugin-v2 does not need to start "plugin" as a separate process, thus
Docker is able to properly restart plugin-v2 in a case of any child
process failing.
- No need for weaveplugin container.
plugin is enabled by default when running "weave launch". when starting
only the router, you should pass "--plugin" parameter to enable it.
The env var WEAVE_NO_PLUGIN is no more.
2017-04-12 13:05:40 +00:00
Martynas Pumputis
4f42029228
Enable WEAVE_{MTU,PASSWORD} env vars, persistence and ARP settings in plugin-v2
...
The vars can be customized before enabling the plugin with e.g.:
docker plugin set $PLUGIN_NAME set WEAVE_MTU=8160
The ARP settings apply to "weave" bridge. In order to manipulate them,
we bind mount the host's /proc to /host/proc.
(The mount type of /proc changed to bind, Otherwise (when type =
"proc"), the kernel does not propagate pids of host processes as the
plugin runs in a separate PID ns.)
Persistence relies on weave.db which is stored under
/var/lib/weave/weave.db on the host.
NOTE: we do not persist peer list for plugin-v2, as it gets
restored from existing alive master nodes during the peer discovery.
2017-04-12 13:05:39 +00:00
Martynas Pumputis
4916badcc4
Move prog/v2-plugin to prog/plugin-v2
2017-04-12 13:05:39 +00:00
Martynas Pumputis
82b56848a9
Add peer discovery for Docker Swarm
...
The peer discovery relies on "GET /info" API call which returns
list of master nodes. The peer list is passed to weaver when
launching it.
If node is a master, then we pass "--ipalloc-alloc
consensus=$(MASTER_NODES_COUNT)" to weaver. Otherwise, we pass
"--ipalloc-alloc observer".
2017-04-12 13:05:39 +00:00
Marc CARRE
b048b6deb0
Bind-mount /proc in V2 plugin container.
...
This allows to pass ARP settings from the host, e.g.:
```
$ sudo docker-runc exec 512af90f342f16dddebc7b7245985d5eb67557e76798b4033eed2ff7adaa4eb5 cat /proc/sys/net/ipv4/neigh/weave/ucast_solicit
3
$ cat /proc/sys/net/ipv4/neigh/weave/ucast_solicit
3
$ cat /proc/sys/net/ipv4/neigh/weave/ucast_solicit
1
$ sudo docker-runc exec 512af90f342f16dddebc7b7245985d5eb67557e76798b4033eed2ff7adaa4eb5 cat /proc/sys/net/ipv4/neigh/weave/ucast_solicit
1
```
2017-04-12 13:05:39 +00:00
Bryan Boreham
0c23e47124
Allow docker API location to be specified or blanked
2017-04-12 13:05:39 +00:00
Bryan Boreham
5bbd886e6f
Build a 'v2' Docker plugin
...
Redirect output to specific log files, because there doesn't seem to
be a 'docker logs' for plugins
2017-04-12 13:05:39 +00:00
Marc Carré
19a31a5b82
Merge pull request #2814 from weaveworks/weaveutil-allids
...
Fetch list of container IDs inside weaveutil
2017-04-12 11:35:37 +01:00
Martynas Pumputis
ceb0186f46
Better error reporing for weaveutil
...
If a weaveutil subcmd is not found, report the fact to stderr.
2017-04-12 09:48:03 +00:00
Bryan Boreham
b307b9872a
Fetch list of container IDs inside weaveutil, for 'weave ps'
2017-04-12 09:36:21 +00:00
Bryan Boreham
5f6c5f6692
Ensure boltDB pathname is constructed uniformly
...
Keep the concatenation of the prefix and filename inside the boltdb
package, so we can't get it wrong outside.
2017-04-11 15:45:04 +00:00
Bryan Boreham
f293063538
Fix print of error
2017-04-10 16:44:10 +00:00
Bryan Boreham
6321512ddb
Use peer count sent back by service
2017-04-10 16:42:47 +00:00
Bryan Boreham
0ca125ff2c
Extract 'HasMode' as method on ipamConfig
2017-04-10 16:42:28 +00:00
Bryan Boreham
57efe0145b
Remove TODO comment - if it's a transient error then enough restarts will get past it
2017-04-10 15:53:23 +00:00
Bryan Boreham
bd53462ab2
Rename 'weavenet' to 'net' in URLs, for simplicity
2017-04-10 15:45:49 +00:00
Bryan Boreham
c8adcb2e79
Wire peer discovery delete into reset and rmpeer
2017-04-10 14:09:06 +00:00
Bryan Boreham
768f89c3de
Move peer http handlers from ipam to weaver
2017-04-10 14:09:06 +00:00