Update docs following merge of proxy & router.

Notes:
- Deleted trailing whitespaces on modified files.
- Added documentation for launch --proxy=false.
This commit is contained in:
Marc CARRE committed 2017-05-16 08:57:17 +01:00
1 parent cb614f01c3
commit cbf1230f6d
7 files changed
+49 -47

No files matched your search

+17 -22
View File
@@ -11,43 +11,40 @@ or the [remote API](https://docs.docker.com/reference/api/docker_remote_api/).
### <a name="attaching-containers"></a>Attaching Containers to a Weave Network ### <a name="attaching-containers"></a>Attaching Containers to a Weave Network
There are three ways to attach containers to a Weave network (which method to use is There are three ways to attach containers to a Weave network (which method to use is
entirely up to you): entirely up to you):
**1.** The Weave Net Docker API Proxy. See [Setting Up the Weave Net Docker API Proxy](#weave-api-proxy). **1.** The Weave Net Docker API Proxy. See [Setting Up the Weave Net Docker API Proxy](#weave-api-proxy).
**2.** The Docker Network Plugin framework. The Docker Network Plugin is used when **2.** The Docker Network Plugin framework. The Docker Network Plugin is used when
Docker containers are started with the --net flag, for example: Docker containers are started with the --net flag, for example:
`docker run --net <docker-run-options>` `docker run --net <docker-run-options>`
**Where,** **Where,**
* `<docker-run-options>` are the [docker run options](https://docs.docker.com/engine/reference/run/) * `<docker-run-options>` are the [docker run options](https://docs.docker.com/engine/reference/run/)
you give to your container on start you give to your container on start
Note that if a Docker container is started with the --net flag, then the Weave Docker API Proxy Note that if a Docker container is started with the --net flag, then the Weave Docker API Proxy
is automatically disabled and is not used to attach containers. is automatically disabled and is not used to attach containers.
See [Integrating Docker via the Network Plugin](/site/plugin.md). See [Integrating Docker via the Network Plugin](/site/plugin.md).
**3.** Containers can also be attached to the Weave network with `weave attach` commands. This method also **3.** Containers can also be attached to the Weave network with `weave attach` commands. This method also
does not use the Weave Docker API Proxy. does not use the Weave Docker API Proxy.
See [Dynamically Attaching and Detaching Containers](/site/using-weave/dynamically-attach-containers.md). See [Dynamically Attaching and Detaching Containers](/site/using-weave/dynamically-attach-containers.md).
### <a name="weave-api-proxy"></a>Setting Up The Weave Net Docker API Proxy ### <a name="weave-api-proxy"></a>Setting Up The Weave Net Docker API Proxy
The proxy sits between the Docker client (command line or API) and the The proxy sits between the Docker client (command line or API) and the
Docker daemon, and intercepts the communication between the two. You can Docker daemon, and intercepts the communication between the two.
start it simultaneously with the router and weaveDNS via `launch`: It is started along with the router and weaveDNS when you run:
host1$ weave launch host1$ weave launch
or independently via `launch-proxy`: **N.B.**: Prior to version 2.0, the `launch-proxy` command allowed to pass configuration options and to start the proxy independently.
This command has been removed in 2.0 and `launch` now also accepts configuration options for the proxy.
host1$ weave launch-router && weave launch-proxy
The first form is more convenient. But only `launch-proxy` can be passed configuration arguments.
Therefore if you need to modify the default behaviour of the proxy, you must use `launch-proxy`.
By default, the proxy decides where to listen based on how the By default, the proxy decides where to listen based on how the
launching client connects to Docker. If the launching client connected launching client connects to Docker. If the launching client connected
@@ -56,7 +53,7 @@ the launching client connects over TCP, the proxy listens on port
12375, on all network interfaces. This can be adjusted using the `-H` 12375, on all network interfaces. This can be adjusted using the `-H`
argument, for example: argument, for example:
host1$ weave launch-proxy -H tcp://127.0.0.1:9999 host1$ weave launch -H tcp://127.0.0.1:9999
If no TLS or listening interfaces are set, TLS is auto-configured If no TLS or listening interfaces are set, TLS is auto-configured
based on the Docker daemon's settings, and the listening interfaces are based on the Docker daemon's settings, and the listening interfaces are
@@ -81,14 +78,12 @@ Alternatively, the proxy host can be set on a per-command basis with
host1$ docker $(weave config) ps host1$ docker $(weave config) ps
The proxy can be stopped independently with The proxy can be stopped, along with the router and weaveDNS, with
host1$ weave stop-proxy host1$ weave stop
or in conjunction with the router and weaveDNS via `stop`.
If you set your `DOCKER_HOST` to point at the proxy, you should revert If you set your `DOCKER_HOST` to point at the proxy, you should revert
to the original settings prior to stopping the proxy. to the original settings prior to running `stop`.
**See Also** **See Also**
@@ -19,17 +19,17 @@ For those situations, the proxy provides the following flags:
* `--hostname-from-label<labelkey>` * `--hostname-from-label<labelkey>`
* `--hostname-match <regexp>` * `--hostname-match <regexp>`
* `--hostname-replacement <replacement>` * `--hostname-replacement <replacement>`
When launching a container, the hostname is initialized to the When launching a container, the hostname is initialized to the
value of the container label using key `<labelkey>`. If no `<labelkey>` was value of the container label using key `<labelkey>`. If no `<labelkey>` was
provided, then the container name is used. provided, then the container name is used.
Additionally, the hostname is matched against a regular expression `<regexp>` and based on that match, Additionally, the hostname is matched against a regular expression `<regexp>` and based on that match,
`<replacement>` is used to obtain the final hostname, and then handed over to weaveDNS for registration. `<replacement>` is used to obtain the final hostname, and then handed over to weaveDNS for registration.
For example, you can launch the proxy using all three flags, as follows: For example, you can launch the proxy using all three flags, as follows:
host1$ weave launch-router && weave launch-proxy --hostname-from-label hostname-label --hostname-match '^aws-[0-9]+-(.*)$' --hostname-replacement 'my-app-$1' host1$ weave launch --hostname-from-label hostname-label --hostname-match '^aws-[0-9]+-(.*)$' --hostname-replacement 'my-app-$1'
host1$ eval $(weave env) host1$ eval $(weave env)
>**Note:** regexp substitution groups must be pre-pended with a dollar sign >**Note:** regexp substitution groups must be pre-pended with a dollar sign
+5 -5
View File
@@ -25,18 +25,18 @@ To start a container without connecting it to the Weave network, pass
If you do not want an IP to be assigned by default, the proxy needs to If you do not want an IP to be assigned by default, the proxy needs to
be passed the `--no-default-ipalloc` flag, for example: be passed the `--no-default-ipalloc` flag, for example:
host1$ weave launch-proxy --no-default-ipalloc host1$ weave launch --no-default-ipalloc
In this configuration, containers using no `WEAVE_CIDR` environment In this configuration, containers using no `WEAVE_CIDR` environment
variable are not connected to the Weave network. variable are not connected to the Weave network.
Containers started with a `WEAVE_CIDR` environment variable are handled as before. Containers started with a `WEAVE_CIDR` environment variable are handled as before.
To automatically assign an address in this mode, start the To automatically assign an address in this mode, start the
container with a blank `WEAVE_CIDR`, for example: container with a blank `WEAVE_CIDR`, for example:
host1$ docker run -ti -e WEAVE_CIDR="" weaveworks/ubuntu host1$ docker run -ti -e WEAVE_CIDR="" weaveworks/ubuntu
**See Also** **See Also**
* [Address Allocation with IP Address Management (IPAM)](/site/ipam.md) * [Address Allocation with IP Address Management (IPAM)](/site/ipam.md)
* [How to Manually Specify IP Addresses and Subnets](/site/using-weave/manual-ip-address.md) * [How to Manually Specify IP Addresses and Subnets](/site/using-weave/manual-ip-address.md)
@@ -9,7 +9,7 @@ When starting Weave Net enabled containers, the proxy automatically
replaces the container's `/etc/hosts` file, and disables Docker's control replaces the container's `/etc/hosts` file, and disables Docker's control
over it. The new file contains an entry for the container's hostname over it. The new file contains an entry for the container's hostname
and Weave Net IP address, as well as additional entries that have been and Weave Net IP address, as well as additional entries that have been
specified using the `--add-host` parameters. specified using the `--add-host` parameters.
This ensures that: This ensures that:
@@ -27,9 +27,9 @@ IP instead of the Weave IP, or you require name resolution for
Docker-managed networks), the proxy must be launched using the Docker-managed networks), the proxy must be launched using the
`--no-rewrite-hosts` flag. `--no-rewrite-hosts` flag.
host1$ weave launch-router && weave launch-proxy --no-rewrite-hosts host1$ weave launch --no-rewrite-hosts
**See Also** **See Also**
* [Using Automatic Discovery With the Weave Proxy](/site/weave-docker-api/automatic-discovery-proxy.md) * [Using Automatic Discovery With the Weave Proxy](/site/weave-docker-api/automatic-discovery-proxy.md)
+4 -4
View File
@@ -8,21 +8,21 @@ If you are [connecting to the docker daemon with
TLS](https://docs.docker.com/articles/https/), you most likely want TLS](https://docs.docker.com/articles/https/), you most likely want
to do the same when connecting to the proxy. The proxy to do the same when connecting to the proxy. The proxy
automatically detects the Docker daemon's TLS configuration, and automatically detects the Docker daemon's TLS configuration, and
attempts to duplicate it. attempts to duplicate it.
In the standard auto-detection case you can launch a TLS-enabled proxy as follows: In the standard auto-detection case you can launch a TLS-enabled proxy as follows:
host1$ weave launch-proxy host1$ weave launch
To disable auto-detection of TLS configuration, you can either pass To disable auto-detection of TLS configuration, you can either pass
the `--no-detect-tls` flag, or you can manually configure the proxy's TLS using the `--no-detect-tls` flag, or you can manually configure the proxy's TLS using
the same TLS-related command-line flags supplied to the Docker the same TLS-related command-line flags supplied to the Docker
daemon. daemon.
For example, if you generated your certificates and keys For example, if you generated your certificates and keys
into the Docker host's `/tls` directory, launch the proxy using: into the Docker host's `/tls` directory, launch the proxy using:
host1$ weave launch-proxy --tlsverify --tlscacert=/tls/ca.pem \ host1$ weave launch --tlsverify --tlscacert=/tls/ca.pem \
--tlscert=/tls/server-cert.pem --tlskey=/tls/server-key.pem --tlscert=/tls/server-cert.pem --tlskey=/tls/server-key.pem
The paths to your certificates and key must be provided as absolute The paths to your certificates and key must be provided as absolute
+14 -7
View File
@@ -5,13 +5,13 @@ search_type: Documentation
--- ---
When containers are created via the Weave Net proxy, their entrypoint is When containers are created via the Weave Net proxy, their entrypoint is
modified to wait for the Weave network interface to become modified to wait for the Weave network interface to become
available. available.
When they are started via the Weave Net proxy, containers are When they are started via the Weave Net proxy, containers are
[automatically assigned IP addresses](/site/ipam.md) and connected to the [automatically assigned IP addresses](/site/ipam.md) and connected to the
Weave network. Weave network.
### Creating and Starting Containers with the Weave Net Proxy ### Creating and Starting Containers with the Weave Net Proxy
@@ -39,19 +39,19 @@ variable by space-separating them, as in
The Docker NetworkSettings (including IP address, MacAddress, and The Docker NetworkSettings (including IP address, MacAddress, and
IPPrefixLen), are still returned when `docker inspect` is run. If you want IPPrefixLen), are still returned when `docker inspect` is run. If you want
`docker inspect` to return the Weave NetworkSettings instead, then the `docker inspect` to return the Weave NetworkSettings instead, then the
proxy must be launched using the `--rewrite-inspect` flag. proxy must be launched using the `--rewrite-inspect` flag.
This command substitutes the Weave network settings when the container has a This command substitutes the Weave network settings when the container has a
Weave Net IP. If a container has more than one Weave Net IP, then the inspect call Weave Net IP. If a container has more than one Weave Net IP, then the inspect call
only includes one of them. only includes one of them.
host1$ weave launch-router && weave launch-proxy --rewrite-inspect host1$ weave launch --rewrite-inspect
### Multicast Traffic and Launching the Weave Proxy ### Multicast Traffic and Launching the Weave Proxy
By default, multicast traffic is routed over the Weave network. By default, multicast traffic is routed over the Weave network.
To turn this off, for example, because you want to configure your own multicast To turn this off, for example, because you want to configure your own multicast
route, add the `--no-multicast-route` flag to `weave launch-proxy`. route, add the `--no-multicast-route` flag to `weave launch`.
### Other Weave Proxy options ### Other Weave Proxy options
@@ -61,6 +61,13 @@ route, add the `--no-multicast-route` flag to `weave launch-proxy`.
* `--no-restart` -- remove the default policy of `--restart=always`, if * `--no-restart` -- remove the default policy of `--restart=always`, if
you want to control start-up of the proxy yourself you want to control start-up of the proxy yourself
### Disabling Weave Proxy
If for some reason you need to disable the proxy, but still want to start other Weave Net components (router, weaveDNS), you can do so using:
weave launch --proxy=false
**See Also** **See Also**
* [Setting Up The Weave Docker API Proxy](/site/weave-docker-api.md) * [Setting Up The Weave Docker API Proxy](/site/weave-docker-api.md)
+1 -1
View File
@@ -40,7 +40,7 @@ the hostname is not in the weaveDNS domain, the container is *not*
registered, but it will still use weaveDNS for resolution. registered, but it will still use weaveDNS for resolution.
To disable an application container's use of weaveDNS, add the To disable an application container's use of weaveDNS, add the
`--without-dns` option to `weave launch-proxy`. To `--without-dns` option to `weave launch`. To
disable weaveDNS itself, launch weave with the `--no-dns` option. disable weaveDNS itself, launch weave with the `--no-dns` option.
**See Also** **See Also**