Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1009 from awh/weave_launch_all_the_things
Browse files Browse the repository at this point in the history
Weave launch all the things

Closes #962.
  • Loading branch information
rade committed Jun 26, 2015
2 parents 039a203 + d4c1766 commit 55fbffe
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 136 deletions.
2 changes: 0 additions & 2 deletions site/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,8 @@ Let's begin by configuring weave's allocator to manage multiple
subnets:

host1$ weave launch -iprange 10.2.0.0/16 -ipsubnet 10.2.1.0/24
host1$ weave launch-dns && weave launch-proxy
host1$ eval $(weave proxy-env)
host2$ weave launch -iprange 10.2.0.0/16 -ipsubnet 10.2.1.0/24 $HOST1
host2$ weave launch-dns && weave launch-proxy
host2$ eval $(weave proxy-env)

This delegates the entire 10.2.0.0/16 subnet to weave, and instructs
Expand Down
17 changes: 13 additions & 4 deletions site/proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ instead of `weave run`.
## <a name="setup"></a>Setup

The proxy sits between the Docker client (command line or API) and the
Docker daemon, intercepting the communication between the two.
Docker daemon, intercepting the communication between the two. You can
start it simultaneously with the router and weaveDNS via `launch`:

To start the proxy, run
host1$ weave launch

host1$ weave launch-proxy
or independently via `launch-proxy`:

host1$ weave launch-router && weave launch-dns && weave launch-proxy

The first form is more convenient, however you can only pass proxy
related configuration arguments to `launch-proxy` so if you need to
modify the default behaviour you will have to use the latter.

By default, the proxy listens on port 12375, on all network
interfaces. This can be adjusted with the `-H` argument, e.g.
Expand All @@ -49,10 +56,12 @@ Alternatively, the proxy host can be set on a per-command basis with

host1$ docker $(weave proxy-config) ps

The proxy can be stopped with
The proxy can be stopped independently with

host1$ weave stop-proxy

or in conjunction with the router and weaveDNS via `stop`.

If you set your `DOCKER_HOST` to point at the proxy, remember to
revert to the original setting.

Expand Down
24 changes: 19 additions & 5 deletions site/weavedns.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,23 @@ hosts.

WeaveDNS is deployed as a set of containers that communicate with each
other over the weave network. One such container needs to be started
on every weave host, by invoking the weave script command
`launch-dns`:
on every weave host, either simultaneously with the router and proxy
via `launch`:

```bash
host1$ weave launch && weave launch-dns && weave launch-proxy
host1$ weave launch
host1$ eval $(weave proxy-env)
```
or independently via `launch-dns`:

```bash
host1$ weave launch-router && weave launch-dns && weave launch-proxy
host1$ eval $(weave proxy-env)
```

The first form is more convenient, however you can only pass weaveDNS
related configuration arguments to `launch-dns` so if you need to
modify the default behaviour you will have to use the latter.

Application containers will use weaveDNS automatically if it is
running at the point when they are started. They will use it for name
Expand Down Expand Up @@ -67,7 +77,11 @@ however specify an address in CIDR format manually. In this case you
are responsible for ensuring that the IP addresses specified are
uniquely allocated and not in use by any other container.

Finally, WeaveDNS containers can be stopped with `stop-dns`.
Finally, weaveDNS can be stopped independently with

host1$ weave stop-dns

or in conjunction with the router and proxy via `stop`.

## <a name="how-it-works"></a>How it works

Expand Down Expand Up @@ -112,7 +126,7 @@ Returning to our earlier example, let us start an additional `pingme`
container, this time on the 2nd host, and then run some ping tests...

```bash
host2$ weave launch && weave launch-dns && weave launch-proxy
host2$ weave launch
host2$ eval $(weave proxy-env)
host2$ docker run -dti --name=pingme ubuntu

Expand Down
8 changes: 4 additions & 4 deletions test/150_connect_forget_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ assert_peers() {

start_suite "Connecting and forgetting routers after launch"

weave_on $HOST1 launch
weave_on $HOST2 launch
weave_on $HOST1 launch-router
weave_on $HOST2 launch-router

start_container $HOST1 $C1/24 --name=c1
start_container $HOST2 $C2/24 --name=c2
Expand All @@ -33,8 +33,8 @@ assert_raises "exec_on $HOST1 c1 $PING $C2"

# Forget everyone and disonnect
assert_raises "weave_on $HOST2 forget $HOST1 $HOST2"
assert_raises "weave_on $HOST1 stop"
assert_raises "weave_on $HOST1 launch"
assert_raises "weave_on $HOST1 stop-router"
assert_raises "weave_on $HOST1 launch-router"
assert_peers $HOST2 ""
assert_raises "exec_on $HOST1 c1 sh -c '! $PING $C2'"

Expand Down
4 changes: 2 additions & 2 deletions test/210_dns_multicast_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ check() {

start_suite "Resolve names across hosts (with and without IPAM), and repopulate on restart"

weave_on $HOST1 launch -iprange $UNIVERSE
weave_on $HOST2 launch -iprange $UNIVERSE $HOST1
weave_on $HOST1 launch-router -iprange $UNIVERSE
weave_on $HOST2 launch-router -iprange $UNIVERSE $HOST1

start_container $HOST2 $C2/24 --name=c2 -h $NAME2
start_container_with_dns $HOST1 $C1/24 --name=c1
Expand Down
2 changes: 1 addition & 1 deletion test/280_with_or_without_dns_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ assert_resolution() {

start_suite "With or without DNS test"

weave_on $HOST1 launch
weave_on $HOST1 launch-router

DNS_IP=$(weave_on $HOST1 docker-bridge-ip)

Expand Down
2 changes: 1 addition & 1 deletion test/500_weave_multi_cidr_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ start_suite "Weave run/start/attach/detach/expose/hide with multiple cidr argume
# specific address, i.e. we are assuming that IPAM always returns the
# lowest available address in the subnet

weave_on $HOST1 launch -debug -iprange 10.2.3.0/24
weave_on $HOST1 launch-router -debug -iprange 10.2.3.0/24
launch_dns_on $HOST1 10.254.254.254/24

# Run container with three cidrs
Expand Down
2 changes: 1 addition & 1 deletion test/620_proxy_entrypoint_command_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ run_container "grep ^1$ /sys/class/net/ethwe/carrier"
build_image false '["/bin/false"]' ''
run_container "--entrypoint='grep' false ^1$ /sys/class/net/ethwe/carrier"

weave_on $HOST1 launch -iprange 10.2.2.0/24
weave_on $HOST1 launch-router -iprange 10.2.2.0/24
docker_on $HOST1 kill weaveproxy
weave_on $HOST1 launch-proxy

Expand Down
2 changes: 1 addition & 1 deletion test/650_proxy_env_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ assert_raises "docker $(weave_on $HOST1 proxy-config) $CMD"
# Check we can use the weave script through the proxy
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; $WEAVE version"
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; $WEAVE ps"
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; $WEAVE launch"
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; $WEAVE launch-router"

end_suite
4 changes: 2 additions & 2 deletions test/660_proxy_ipam_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ assert_no_ethwe() {

start_suite "Ping proxied containers over cross-host weave network (with IPAM)"

weave_on $HOST1 launch -iprange $UNIVERSE
weave_on $HOST2 launch -iprange $UNIVERSE $HOST1
weave_on $HOST1 launch-router -iprange $UNIVERSE
weave_on $HOST2 launch-router -iprange $UNIVERSE $HOST1
weave_on $HOST1 launch-proxy
weave_on $HOST2 launch-proxy --no-default-ipam

Expand Down
2 changes: 1 addition & 1 deletion test/670_proxy_tls_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ start_suite "Boot the proxy with TLS-enabled Docker support"

PWD=$($SSH $HOST1 pwd)

weave_on $HOST1 launch
weave_on $HOST1 launch-router
weave_on $HOST1 launch-proxy \
--tlsverify \
--tlscacert $PWD/tls/ca.pem \
Expand Down
Loading

0 comments on commit 55fbffe

Please sign in to comment.