Commit Graph
109 Commits
Author SHA1 Message Date
Matthias Radestock e2ec460752 feed password to weave via env var, possibly via a file
The latter is the most secure route since it keeps the password
completely out of any command lines, and the permissions on the file
can be very restrictive, e.g. 0400.

It would be somewhat nicer if the password file contained just
    <password>
rather than
    WEAVE_PASSWORD=<password>
but then we'd have to transit the password via a temporary file with
0600 permissions.
2014-12-20 01:22:59 +00:00
Michael Bridgen 7187d38047 Merge remote-tracking branch 'rade/189_assert_docker_networking' 2014-11-28 14:06:16 +00:00
Michael Bridgen 56056c06b1 Merge remote-tracking branch 'rade/186_stop_dns' 2014-11-28 12:55:43 +00:00
Bryan Boreham ccd6cb0440 Use full container names when populating weavedns. Fixes #250 2014-11-28 12:49:05 +00:00
Bryan Boreham f2ef3dcfe7 Merge pull request #243 from rade/240_dns_without_docker_net
LGTM.  Fixes #240
2014-11-28 12:16:40 +00:00
Bryan Boreham 33fb296769 Merge pull request #245 from rade/238_check_docker_version_when_using_dns
Looks good to me.  Fixes #238
2014-11-28 11:17:13 +00:00
Matthias Radestock 57242f790e check that weave container has an eth0
since w/o that we get an obscure error.

The most likely cause for not having an eth0 is that the docker daemon
has been configured to disable container networking.
2014-11-28 11:06:36 +00:00
Bryan Boreham a3482c9f2d Merge pull request #244 from rade/233_stop_on_docker_run_errors
LGTM.  Fixes #233
2014-11-28 11:01:51 +00:00
Matthias Radestock 8a6c7f7d22 Merge branch '233_stop_on_docker_run_errors' into 238_check_docker_version_when_using_dns 2014-11-28 10:42:33 +00:00
Matthias Radestock b18b24b3f3 --version -> -v 2014-11-28 10:40:59 +00:00
Matthias Radestock c070f0b08c add weave stop-dns
and in the process disentangle stopping dns from `weave stop`
2014-11-28 10:13:48 +00:00
Matthias Radestock d707ed5df0 we should never write messages to stdout 2014-11-28 10:00:46 +00:00
Matthias Radestock fd6f19cc44 check for Docker version >= 1.2.0 when using "--with-dns"
since --dns-search=. is is new in that version
2014-11-28 09:10:14 +00:00
Matthias Radestock 2da534445a stop on 'docker run' errors
This broke due to our workaround for
https://github.com/docker/docker/issues/8632, which affects Docker
version 1.3.0 only, so now we refuse to run with that.
2014-11-28 00:57:49 +00:00
Matthias Radestock 010d488ad7 refactor: simplify regexp 2014-11-27 17:32:44 +00:00
Matthias Radestock 24702e3a7a stop weavedns from complaining when a container has no docker ip
e.g. when it was started with --net=none

weavedns wasn't actually using the docker-assigned ip for anything, so
this change is a simple matter of eradicating it from the code.
2014-11-27 16:13:06 +00:00
Matthias Radestock 65c77df279 less noise 2014-11-27 15:27:59 +00:00
Matthias Radestock 625df2e7d5 refactor(ish): move veth creation into one place
This simplifies the code, but means we do end up invoking ethtool on
the weave container's ethwe, which isn't necessary but harmless.
2014-11-27 11:11:29 +00:00
Matthias Radestock 29b3db6c05 run ethtool outside container netns
We want to run as little as possible inside the container netns.

Unfortunately we cannot make that change for the weave container,
since the interface on which we need to invoke ethtool is created by
docker and already inside the container netns by the time we get
control.
2014-11-27 10:20:25 +00:00
Matthias Radestock 1ba1f63776 refactor 2014-11-27 10:07:30 +00:00
Matthias Radestock d9ea3b44a1 always mark the interface as 'up' last
since that kinda acts as a marker that everything is ready
2014-11-27 09:56:12 +00:00
Matthias Radestock 8fac46a429 refactor: introduce a helper 2014-11-27 09:39:47 +00:00
Matthias Radestock ed1db251d8 even better comment 2014-11-27 08:45:49 +00:00
Matthias Radestock c8ecfec211 correct comment 2014-11-27 08:42:27 +00:00
Michael Bridgen b3d19d6e9d Wait for weaveDNS HTTP to be running before sending it names
This adds a no-op endpoint to the HTTP API at `/status`. The script
simply tries this until it succeeds or gets bored.
2014-11-26 14:18:26 +00:00
Michael Bridgen 6a076d05b0 Only get the DNS container IP once
`populate_dns` previously used http_call, which looks up the IP for a
container each time. I've factored the HTTP bit after the IP look-up
in http_call out, so it can be used directly. This involved switching
arguments around to make the tail call easier.
2014-11-26 14:18:26 +00:00
Michael Bridgen 3d8249b4c3 Populate DNS when starting the weaveDNS container 2014-11-26 14:18:26 +00:00
Michael Bridgen 2534977f99 Make weaveDNS use the docker bridge IP instead of its own
This means the `--dns` setting for containers will work even if the
weavedns container is restarted (and assigned a new docker network
IP).
2014-11-26 13:16:52 +00:00
Michael Bridgen 6e8060cb7f Merge branch '208_opt_in' of github.com:bboreham/weave into pr234_with_dns 2014-11-25 14:33:02 +00:00
Bryan Boreham 4046c3a8bc Undid extra check that there is at least one argument to 'docker run' 2014-11-25 14:13:40 +00:00
Bryan Boreham 0b051db5e1 Simplify arg parsing on weave run 2014-11-25 14:09:26 +00:00
Ilya Dmitrichenko 9280bb8268 Improve kernel version matcher (close #185) 2014-11-25 11:51:12 +00:00
Bryan Boreham 19f6c17f69 Two minus signs 2014-11-25 11:01:05 +00:00
Bryan Boreham 42f0cb883a Add --with-dns option to weave run 2014-11-24 20:14:01 +00:00
Bryan Boreham 21b190ed41 Revert "Use Docker bridge IP for DNS" 2014-11-24 18:02:11 +00:00
Michael Bridgen 95430cb528 Make weaveDNS use the docker bridge IP instead of its own
This means the `--dns` setting for containers will work even if the
weavedns container is restarted (and assigned a new docker network
IP).
2014-11-21 16:23:56 +00:00
rade 2f47dbddae Merge pull request #210 from squaremo/remove_redundant_shellfunc
Remove redundant shell function
2014-11-20 14:46:14 +00:00
Michael Bridgen 64b20d8f30 Remove redundant shell function
This was used before http_call was made, but that function effectively
inlines it.
2014-11-19 16:20:53 +00:00
Ilya Dmitrichenko a637294f2f Add kernel version check (close #185)
_NOTE: You will need to satisfy kernel requirements for Docker._ It's
currently recommended to use 3.10, although 3.8 works as well. We have
done some additional testing on Ubuntu Preciese, and found that the
oldest kernel that Ubuntu ships and weave happily runs on is 3.5,
presumably some some of the issues had been fix since Docker docs were
last updated. This is not to say that kernel version is good one to use,
we do recommend to use the latest, but just in case if you have any
specific reason why you cannot upgrade, then the 3.5 is the oldest we
have tried.
2014-11-19 15:37:21 +00:00
Matthias Radestock 308ef865c5 simplify 2014-11-17 17:39:33 +00:00
Michael Bridgen 61d2595c76 Better phrasing for http_call error messages 2014-11-17 16:28:11 +00:00
Michael Bridgen 40de90a4c2 Better terminologicals for no-IP case 2014-11-17 16:25:08 +00:00
Michael Bridgen dce73559b7 Differentiate between failure cases in http_call
.. otherwise, no networking can look like no running container.
2014-11-17 15:58:11 +00:00
Michael Bridgen a61080e025 Supply a --dns-search to blank the inherited resolv.conf search
In the absence of *either* a `--dns` or `--dns-search` argument,
Docker will write a `/etc/resolv.conf` based on the host's. Since, in
general, we rely on the DNS search path being empty (so that the
resolver uses the local domain), we want to blank the
`/etc/resolv.conf` by providing `--dns-search=.` when running a
container.

However, if there's a `--dns-search=` in the remainder of the args,
Docker will append them to the dot, which breaks resolution. Not good.

So, we only "blank" the search path if there's no `--dns-search`
argument present already.
2014-11-11 15:23:06 +00:00
Matthias Radestock a34e214201 expose DNS port via Dockerfile rather than 'docker run' argument
That is "the Docker way".

Related to #141.
2014-11-11 12:52:17 +00:00
Matthias Radestock 2fb79da625 make DNS work when docker is running with --icc=false
1) expose the DNS port from the weavedns container
2) link all application containers to the weavedns container
2014-11-08 15:34:23 +00:00
Matthias Radestock 9c620e81d6 kill dns container on weave stop
since just running `docker rm -f` has a nasty habit of getting stuck
sometimes.
2014-11-07 12:27:34 +00:00
Matthias Radestock 2fd9b91fc1 remove weavedns container on weave reset
(and some cosmetics)

Fixes #171
2014-11-06 22:38:07 +00:00
Matthias Radestock eacc14dfe2 tidying: remove superfluous var 2014-11-06 22:05:14 +00:00
Matthias Radestock a16c6acc32 properly detach containers from network on 'weave reset'
since otherwise we are leaving veth pairs behind which a) breaks a
subsequent 'weave attach', and b) runs contrary to 'weave reset's
stated purpose of removing all traces of weave.

NB: This does yank the ethwe interface from the containers.

Fixes #164
2014-11-06 22:02:24 +00:00