fixed formatting for wp and spellcheck
This commit is contained in:
1 parent
d68c1a8187
commit
b3b93b28df
37 files changed
+283
-120
No files matched your search
@@ -28,27 +28,33 @@ Additionally, the hostname is matched against a regular expression `<regexp>` an
|
||||
|
||||
For example, you can launch the proxy using all three flags, as follows:
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch-router && weave launch-proxy --hostname-from-label hostname-label --hostname-match '^aws-[0-9]+-(.*)$' --hostname-replacement 'my-app-$1'
|
||||
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
|
||||
(for example, `$1`). For further details on the regular expression syntax see
|
||||
[Google's re2 documentation](https://github.com/google/re2/wiki/Syntax).
|
||||
|
||||
After launching the Weave Net proxy with these flags, running a container named `aws-12798186823-foo` without labels results in weavedns registering the hostname `my-app-foo` and not `aws-12798186823-foo`.
|
||||
|
||||
~~~bash
|
||||
host1$ docker run -ti --name=aws-12798186823-foo ubuntu ping my-app-foo
|
||||
PING my-app-foo.weave.local (10.32.0.2) 56(84) bytes of data.
|
||||
64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=1 ttl=64 time=0.027 ms
|
||||
64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=2 ttl=64 time=0.067 ms
|
||||
~~~
|
||||
|
||||
Also, running a container named `foo` with the label
|
||||
`hostname-label=aws-12798186823-foo` leads to the same hostname registration.
|
||||
|
||||
~~~bash
|
||||
host1$ docker run -ti --name=foo --label=hostname-label=aws-12798186823-foo ubuntu ping my-app-foo
|
||||
PING my-app-foo.weave.local (10.32.0.2) 56(84) bytes of data.
|
||||
64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=1 ttl=64 time=0.031 ms
|
||||
64 bytes from my-app-foo.weave.local (10.32.0.2): icmp_seq=2 ttl=64 time=0.042 ms
|
||||
~~~
|
||||
|
||||
This is because, as explained above, if providing `--hostname-from-label`
|
||||
to the proxy, the specified label takes precedence over the container's name.
|
||||
|
||||
@@ -8,24 +8,31 @@ If [automatic IP address allocation](/site/ipam/overview-init-ipam.md) is enable
|
||||
then containers started via the proxy are automatically assigned an IP address, *without having to specify any
|
||||
special environment variables or any other options*.
|
||||
|
||||
~~~bash
|
||||
host1$ docker run -ti ubuntu
|
||||
~~~
|
||||
|
||||
To use a specific subnet, you can pass a `WEAVE_CIDR` to the container, for example:
|
||||
|
||||
~~~bash
|
||||
host1$ docker run -ti -e WEAVE_CIDR=net:10.32.2.0/24 ubuntu
|
||||
~~
|
||||
|
||||
To start a container without connecting it to the Weave network, pass
|
||||
`WEAVE_CIDR=none`, for example:
|
||||
|
||||
~~~bash
|
||||
host1$ docker run -ti -e WEAVE_CIDR=none ubuntu
|
||||
|
||||
~~~
|
||||
|
||||
###Disabling Automatic IP Address Allocation
|
||||
|
||||
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:
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch-proxy --no-default-ipalloc
|
||||
~~~
|
||||
|
||||
In this configuration, containers using no `WEAVE_CIDR` environment
|
||||
variable are not connected to the Weave network.
|
||||
@@ -34,7 +41,9 @@ Containers started with a `WEAVE_CIDR` environment variable are handled as befor
|
||||
To automatically assign an address in this mode, start the
|
||||
container with a blank `WEAVE_CIDR`, for example:
|
||||
|
||||
~~~bash
|
||||
host1$ docker run -ti -e WEAVE_CIDR="" ubuntu
|
||||
~~~
|
||||
|
||||
**See Also**
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ layout: default
|
||||
If you don't want to use the proxy, you can also launch
|
||||
containers on to the Weave network using `weave run`:
|
||||
|
||||
~~~bash
|
||||
$ weave run -ti ubuntu
|
||||
~~~
|
||||
|
||||
The arguments after `run` are passed through to `docker run`. Therefore you
|
||||
can freely specify whatever Docker options you need.
|
||||
@@ -17,14 +19,18 @@ this example, it obtains an automatically allocated IP.
|
||||
|
||||
You can specify IP addresses manually instead:
|
||||
|
||||
~~~bash
|
||||
$ weave run 10.2.1.1/24 -ti ubuntu
|
||||
~~~
|
||||
|
||||
`weave run` rewrites `/etc/hosts` in the same way
|
||||
[the proxy does](/site/weave-docker-api/name-resolution-proxy.md). If you need to keep
|
||||
the original file, specify `--no-rewrite-hosts` when running
|
||||
the container:
|
||||
|
||||
~~~bash
|
||||
$ weave run --no-rewrite-hosts 10.2.1.1/24 -ti ubuntu
|
||||
~~~
|
||||
|
||||
There are some limitations to starting containers using `weave run`:
|
||||
|
||||
|
||||
@@ -26,7 +26,9 @@ IP instead of the Weave IP, or you require name resolution for
|
||||
Docker-managed networks), the proxy must be launched using the
|
||||
`--no-rewrite-hosts` flag.
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch-router && weave launch-proxy --no-rewrite-hosts
|
||||
~~~
|
||||
|
||||
**See Also**
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ attempts to duplicate it.
|
||||
|
||||
In the standard auto-detection case you can launch a TLS-enabled proxy as follows:
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch-proxy
|
||||
~~~
|
||||
|
||||
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
|
||||
@@ -21,8 +23,10 @@ daemon.
|
||||
For example, if you generated your certificates and keys
|
||||
into the Docker host's `/tls` directory, launch the proxy using:
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch-proxy --tlsverify --tlscacert=/tls/ca.pem \
|
||||
--tlscert=/tls/server-cert.pem --tlskey=/tls/server-key.pem
|
||||
~~~
|
||||
|
||||
The paths to your certificates and key must be provided as absolute
|
||||
paths as they exist on the Docker host.
|
||||
@@ -37,18 +41,20 @@ for an example.
|
||||
With the proxy running over TLS, you can configure the Docker
|
||||
client to use TLS on a per-invocation basis by running:
|
||||
|
||||
~~~bash
|
||||
$ docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem \
|
||||
--tlskey=key.pem -H=tcp://host1:12375 version
|
||||
...
|
||||
~~~
|
||||
|
||||
or, [by default](https://docs.docker.com/articles/https/#secure-by-default), using:
|
||||
|
||||
~~~bash
|
||||
$ mkdir -pv ~/.docker
|
||||
$ cp -v {ca,cert,key}.pem ~/.docker
|
||||
$ eval $(weave env)
|
||||
$ export DOCKER_TLS_VERIFY=1
|
||||
$ docker version
|
||||
...
|
||||
~~~
|
||||
|
||||
This is exactly the same configuration used when connecting to the
|
||||
Docker daemon directly, except that the specified port is the Weave
|
||||
|
||||
@@ -17,14 +17,18 @@ The proxy sits between the Docker client (command line or API) and the
|
||||
Docker daemon, and intercepts the communication between the two. You can
|
||||
start it simultaneously with the router and weavedns via `launch`:
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch
|
||||
~~~
|
||||
|
||||
or independently via `launch-proxy`:
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch-router && weave launch-proxy
|
||||
~~~
|
||||
|
||||
The first form is more convenient. But only `launch-proxy` can be passed configuration arguments.
|
||||
Therefor if you need to modify the default behaviour of the proxy, you must use `launch-proxy`.
|
||||
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
|
||||
launching client connects to Docker. If the launching client connected
|
||||
@@ -33,11 +37,13 @@ the launching client connects over TCP, the proxy listens on port
|
||||
12375, on all network interfaces. This can be adjusted using the `-H`
|
||||
argument, for example:
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch-proxy -H tcp://127.0.0.1:9999
|
||||
~~~
|
||||
|
||||
If no TLS or listening interfaces are set, TLS is autoconfigured
|
||||
If no TLS or listening interfaces are set, TLS is auto-configured
|
||||
based on the Docker daemon's settings, and the listening interfaces are
|
||||
autoconfigured based on your Docker client's settings.
|
||||
auto-configured based on your Docker client's settings.
|
||||
|
||||
Multiple `-H` arguments can be specified. If you are working with a
|
||||
remote docker daemon, then any firewalls in between need to be
|
||||
@@ -47,23 +53,30 @@ All docker commands can be run via the proxy, so it is safe to adjust
|
||||
your `DOCKER_HOST` to point at the proxy. Weave Net provides a convenient
|
||||
command for this:
|
||||
|
||||
~~~bash
|
||||
host1$ eval $(weave env)
|
||||
host1$ docker ps
|
||||
...
|
||||
~~~
|
||||
|
||||
The prior settings can be restored with
|
||||
|
||||
~~~bash
|
||||
host1$ eval $(weave env --restore)
|
||||
~~~
|
||||
|
||||
Alternatively, the proxy host can be set on a per-command basis with
|
||||
|
||||
~~~bash
|
||||
host1$ docker $(weave config) ps
|
||||
~~~
|
||||
|
||||
The proxy can be stopped independently with
|
||||
|
||||
~~~bash
|
||||
host1$ weave stop-proxy
|
||||
~~~
|
||||
|
||||
or in conjunction with the router and weaveDNS via `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
|
||||
to the original settings prior to stopping the proxy.
|
||||
|
||||
@@ -5,20 +5,23 @@ layout: default
|
||||
|
||||
The command
|
||||
|
||||
~~~bash
|
||||
weave status
|
||||
~~~
|
||||
|
||||
reports on the current status of various Weave Net components, including
|
||||
the proxy, if it is running:
|
||||
|
||||
````
|
||||
...
|
||||
~~~bash
|
||||
weave proxy is running
|
||||
````
|
||||
~~~
|
||||
|
||||
Information on the operation of the proxy can be obtained from the
|
||||
weaveproxy container logs using:
|
||||
|
||||
~~~bash
|
||||
docker logs weaveproxy
|
||||
~~~
|
||||
|
||||
**See Also**
|
||||
|
||||
|
||||
@@ -16,18 +16,24 @@ Weave network.
|
||||
|
||||
To create and start a container via the Weave Net proxy run:
|
||||
|
||||
~~~bash
|
||||
host1$ docker run -ti ubuntu
|
||||
~~~
|
||||
|
||||
or, equivalently run:
|
||||
|
||||
~~~bash
|
||||
host1$ docker create -ti ubuntu
|
||||
5ef831df61d50a1a49272357155a976595e7268e590f0a2c75693337b14e1382
|
||||
host1$ docker start 5ef831df61d50a1a49272357155a976595e7268e590f0a2c75693337b14e1382
|
||||
~~~
|
||||
|
||||
Specific IP addresses and networks can be supplied in the `WEAVE_CIDR`
|
||||
environment variable, for example:
|
||||
|
||||
~~~bash
|
||||
host1$ docker run -e WEAVE_CIDR=10.2.1.1/24 -ti ubuntu
|
||||
~~~
|
||||
|
||||
Multiple IP addresses and networks can be supplied in the `WEAVE_CIDR`
|
||||
variable by space-separating them, as in
|
||||
@@ -45,8 +51,9 @@ 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
|
||||
only includes one of them.
|
||||
|
||||
~~~bash
|
||||
host1$ weave launch-router && weave launch-proxy --rewrite-inspect
|
||||
|
||||
~~~
|
||||
|
||||
###Multicast Traffic and Launching the Weave Proxy
|
||||
|
||||
|
||||
Reference in new issue
Block a user