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
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
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
Bryan Boreham
e2d644b86b
Peer Discovery via a web service
2017-04-10 14:09:06 +00:00
Bryan Boreham
c6457981ab
Merge branch '1.9'
2017-03-21 14:14:01 +00:00
Bryan Boreham
d9ca54e777
Don't use Printf without a format
2017-03-21 11:38:35 +00:00
Bryan Boreham
1f6a6349a9
Remove useless 'break'
2017-03-21 11:38:35 +00:00
Bryan Boreham
ef7571f1ef
Can't catch SIGKILL
2017-03-21 11:38:35 +00:00
Bryan Boreham
1d55ee19e4
Merge branch '1.9'
2017-03-17 11:46:32 +00:00
Bryan Boreham
9da5cee8d9
Rename Kubernetes daemonset to "1.6"
...
To emphasise this is the version that adopters of Kubernetes 1.6 need
to use.
2017-03-17 11:45:06 +00:00
Lucas Käldström
2e58e92d48
Add a weave-kube manifest that works for kubeadm v1.6
2017-03-17 11:43:48 +00:00
Bryan Boreham
9810a84475
Merge branch '1.9'
2017-03-16 19:43:50 +00:00
Bryan Boreham
c3c28ea27e
Update CNI library to version 0.5.0
2017-03-16 18:23:20 +00:00
Bryan Boreham
623abeef4c
gofmt
2017-03-14 17:56:59 +00:00
Stephan Austermühle
dc2925263c
Destroy ipsets prefixed weave- only (issue #2751 )
2017-03-14 17:56:59 +00:00
Marc CARRE
21a0fc30e8
Run weaver without exec.
...
This:
1. prevents from generating defunct (a.k.a. zombie) processes, and therefore fixes #2836 ; but also
2. reintroduces #2684/#2688 as shells do not forward signals and we are still running more than one process.
A proper fix would leverage something like tini.
See also:
- github.com/krallin/tini
- github.com/krallin/tini/issues/8
- github.com/docker-library/official-images#init
Sample output:
- during initialisation:
```
$ ps auxf
[...]
root 1380 0.4 1.9 879660 74660 ? Ssl Mar13 6:02 /usr/bin/docker daemon -H fd:// -H unix:///
root 1664 0.0 0.4 502116 18528 ? Ssl Mar13 0:06 \_ docker-containerd -l /var/run/docker/li
root 15482 0.0 0.0 200496 3364 ? Sl 15:04 0:00 \_ docker-containerd-shim 3d1f5eb6e090
root 15496 0.0 0.0 1524 996 ? Ss 15:04 0:00 | \_ /bin/sh /home/weave/launch.sh
root 15780 0.0 0.0 1524 64 ? S 15:04 0:00 | \_ /bin/sh /home/weave/launch.
root 15872 0.0 0.0 1772 1272 ? S 15:04 0:00 | | \_ /bin/sh /home/weave/wea
root 15897 0.0 0.0 1772 324 ? S 15:04 0:00 | | \_ /bin/sh /home/weave
root 15898 0.0 0.0 14656 2948 ? S 15:04 0:00 | | \_ curl -o /tmp/we
root 15781 10.0 1.5 484556 60296 ? Sl 15:04 0:00 | \_ /home/weave/weaver --port=6
[...]
```
- after initialisation:
```
$ ps auxf
[...]
root 1380 0.4 1.9 879660 74660 ? Ssl Mar13 6:02 /usr/bin/docker daemon -H fd:// -H unix:///
root 1664 0.0 0.4 502116 18592 ? Ssl Mar13 0:06 \_ docker-containerd -l /var/run/docker/li
root 15482 0.0 0.0 200496 3364 ? Sl 15:04 0:00 \_ docker-containerd-shim 3d1f5eb6e090
root 15496 0.0 0.0 1524 996 ? Ss 15:04 0:00 | \_ /bin/sh /home/weave/launch.sh
root 15781 2.3 1.6 503064 64320 ? Sl 15:04 0:00 | \_ /home/weave/weaver --port=6[...]
```
2017-03-14 15:34:47 +00:00
Bryan Boreham
8468183738
'redacted' is a better word than 'elided'
2017-03-09 10:44:48 +00:00
Bryan Boreham
39563fc142
Merge pull request #2829 from dlmiddlecote/issues/2815-check-live-containers
...
Only check running containers for existing addresses
2017-03-09 09:53:03 +00:00
Daniel Middlecote
104d2240ec
Move container lists to scope they are used in
2017-03-08 21:43:21 +00:00
Daniel Middlecote
fd28740108
Only check running containers for existing addresses
2017-03-06 22:10:45 +00:00
Bryan Boreham
fa74d1b9bb
Merge two ADD commands to remove a layer
2017-03-06 11:29:09 +00:00
Bryan Boreham
e2c96cfa85
Remove/move down WORKDIR lines in Dockerfiles
...
They seem to stop Docker using its build cache.
Removing the line entirely stops weaveproxy from working, as it
assumes it can exec `./weave` from the current directory.
2017-03-06 11:29:09 +00:00
Martynas Pumputis
3607cf2d7a
Add check for xt_set module
...
The check is based on actually trying to install an iptables rule
which uses the module.
2017-03-01 10:37:43 +00:00
Martynas Pumputis
a57cf4bc83
Ignore modprobe errors in weave-kube/launch.sh
...
weave-kube is run by alpine image which uses busybox. modprobe of
busybox will return the "module not found" error [1], if a module is
built-in, which is an opposite behavior to modprobe distributed in
mainstream distros (e.g. ubuntu).
[1]: https://bugs.busybox.net/show_bug.cgi?id=5270
2017-02-28 11:26:40 +00:00
Bryan Boreham
cb73cf3f51
Ensure we have the kernel modules loaded for weave-npc
2017-02-27 12:32:57 +00:00
Martynas Pumputis
7a3e8e64b7
Merge pull request #2810 from ocadotechnology/add-pending-metrics
...
Add prometheus metrics for pending Allocates and Claims
2017-02-24 15:55:39 +00:00
Bryan Boreham
f7c0da3ae1
Merge pull request #2781 from keontang/luanch-update
...
Add CONN_LIMIT environment var for running container
2017-02-23 12:40:01 +00:00
Mike Bryant
fad537cad7
Add prometheus metrics for pending Allocates and Claims
2017-02-23 11:41:07 +00:00