Added documentation website content, and a workflow to publish it to GitHub Pages
* Copied, rearranged and modified the contents of the old site directory for Jekyll static site generator, into the website directory * Added some Jekyll-specific things for looks, including: * _config.yaml, Gemfile.* and 404.html files * _data, _layouts and assets directories and their content * Added .github/workflows/github-pages-publish.yml workflow
This commit is contained in:
1 parent
92779f3e57
commit
e2db8a25bd
82 files changed
+6162
No files matched your search
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: How Weave Finds Containers
|
||||
menu_order: 10
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
|
||||
The weaveDNS service running on every host acts as the nameserver for
|
||||
containers on that host. It learns about hostnames for local containers
|
||||
from the proxy and from the `weave attach` command.
|
||||
|
||||
If a hostname is in the `.weave.local` domain, then weaveDNS records the association of that
|
||||
name with the container's Weave Net IP address(es) in its in-memory
|
||||
database, and then broadcasts the association to other Weave Net peers in the
|
||||
cluster.
|
||||
|
||||
When weaveDNS is queried for a name in the `.weave.local` domain, it
|
||||
looks up the hostname in its memory database and responds with the IPs
|
||||
of all containers for that hostname across the entire cluster.
|
||||
|
||||
When weaveDNS is queried for a name in a domain other than
|
||||
`.weave.local`, it queries the host's configured nameserver, which is
|
||||
the standard behaviour for Docker containers.
|
||||
|
||||
### Specifying a Different Docker Bridge Device
|
||||
|
||||
So that containers can connect to a stable and always routable IP
|
||||
address, weaveDNS listens on port 53 to the Docker bridge device, which
|
||||
is assumed to be `docker0`. Some configurations may use a different
|
||||
Docker bridge device. To supply a different bridge device, use the
|
||||
environment variable `DOCKER_BRIDGE`, e.g.,
|
||||
|
||||
```
|
||||
$ sudo DOCKER_BRIDGE=someother weave launch
|
||||
```
|
||||
|
||||
In the event that weaveDNS is launched in this way, it's important that
|
||||
other calls to `weave` also specify the bridge device:
|
||||
|
||||
```
|
||||
$ sudo DOCKER_BRIDGE=someother weave attach ...
|
||||
```
|
||||
|
||||
**See Also**
|
||||
|
||||
* [Using WeaveDNS]({{ '/tasks/weavedns/weavedns' | relative_url }})
|
||||
* [Load Balancing with weaveDNS]({{ '/tasks/weavedns/load-balance-fault-weavedns' | relative_url }})
|
||||
* [Managing Domain Entries]({{ '/tasks/weavedns/managing-domains-weavedns' | relative_url }})
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Managing WeaveDNS
|
||||
menu_order: 30
|
||||
search_type: Documentation
|
||||
---
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
title: Load Balancing and Fault Resilience with weaveDNS
|
||||
menu_order: 20
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
|
||||
|
||||
It is permissible to register multiple containers with the same name:
|
||||
weaveDNS returns all addresses, in a random order, for each request.
|
||||
This provides a basic load balancing capability.
|
||||
|
||||
Expanding the [overview example]({{ '/tasks/weavedns/weavedns' | relative_url }}), let us start an additional `pingme` container on a second host, and then run
|
||||
some ping tests.
|
||||
|
||||
```
|
||||
host2$ weave launch $HOST1
|
||||
host2$ eval $(weave env)
|
||||
host2$ docker run -dti --name=pingme weaveworks/ubuntu
|
||||
|
||||
root@ubuntu:/# ping -nq -c 1 pingme
|
||||
PING pingme.weave.local (10.32.0.2) 56(84) bytes of data.
|
||||
...
|
||||
root@ubuntu:/# ping -nq -c 1 pingme
|
||||
PING pingme.weave.local (10.40.0.1) 56(84) bytes of data.
|
||||
...
|
||||
root@ubuntu:/# ping -nq -c 1 pingme
|
||||
PING pingme.weave.local (10.40.0.1) 56(84) bytes of data.
|
||||
...
|
||||
root@ubuntu:/# ping -nq -c 1 pingme
|
||||
PING pingme.weave.local (10.32.0.2) 56(84) bytes of data.
|
||||
...
|
||||
```
|
||||
|
||||
Notice how the ping reaches different addresses.
|
||||
|
||||
However, due to
|
||||
[RFC 3484 address selection](https://tools.ietf.org/html/rfc3484#section-6)
|
||||
most DNS resolver libraries prefer certain addresses over others, to
|
||||
the point where in some circumstances the same address is always
|
||||
chosen. To avoid this behaviour, applications may want to perform
|
||||
their own address selection, e.g. by choosing a random entry from the
|
||||
result of
|
||||
[`getaddrinfo()`](http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html).
|
||||
|
||||
## <a name="fault-resilience"></a>Fault Resilience
|
||||
|
||||
WeaveDNS removes the addresses of any container that dies. This offers
|
||||
a simple way to implement redundancy. E.g. if in our example we stop
|
||||
one of the `pingme` containers and re-run the ping tests, eventually
|
||||
(within ~30s at most, since that is the weaveDNS
|
||||
[cache expiry time]({{ '/tasks/weavedns/managing-entries-weavedns#ttl)' | relative_url }}) we will only be hitting the address of the
|
||||
container that is still alive.
|
||||
|
||||
**See Also**
|
||||
|
||||
* [How Weave Finds Containers]({{ '/tasks/weavedns/how-works-weavedns' | relative_url }})
|
||||
* [Managing Domains]({{ '/tasks/weavedns/managing-domains-weavedns' | relative_url }})
|
||||
* [Managing Domain Entries]({{ '/tasks/weavedns/managing-entries-weavedns' | relative_url }})
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: Managing Domains
|
||||
menu_order: 30
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
The following topics are discussed:
|
||||
|
||||
* [Configuring the domain search path](#domain-search-path)
|
||||
* [Using a different local domain](#local-domain)
|
||||
|
||||
## <a name="domain-search-path"></a>Configuring the domain search paths
|
||||
|
||||
If you don't supply a domain search path (with `--dns-search=`), Weave
|
||||
Net (via the [proxy]({{ '/tasks/weave-docker-api/weave-docker-api' | relative_url }}) or via `weave attach`)
|
||||
tells a container to look for "bare" hostnames, like `pingme`, in its
|
||||
own domain (or in `weave.local` if it has no domain).
|
||||
|
||||
If you want to supply other entries for the domain search path,
|
||||
e.g. if you want containers in different sub-domains to resolve
|
||||
hostnames across all sub-domains plus some external domains, you need
|
||||
*also* to supply the `weave.local` domain to retain the above
|
||||
behaviour.
|
||||
|
||||
```
|
||||
docker run -ti \
|
||||
--dns-search=zone1.weave.local --dns-search=zone2.weave.local \
|
||||
--dns-search=corp1.com --dns-search=corp2.com \
|
||||
--dns-search=weave.local weaveworks/ubuntu
|
||||
```
|
||||
|
||||
## <a name="local-domain"></a>Using a different local domain
|
||||
|
||||
By default, weaveDNS uses `weave.local.` as the domain for names on the
|
||||
Weave network. In general users do not need to change this domain, but
|
||||
you can force weaveDNS to use a different domain by launching it with
|
||||
the `--dns-domain` argument. For example,
|
||||
|
||||
```
|
||||
$ weave launch --dns-domain="mycompany.local."
|
||||
```
|
||||
|
||||
The local domain should end with `local.`, since these names are
|
||||
link-local as per [RFC6762](https://tools.ietf.org/html/rfc6762),
|
||||
(though this is not strictly necessary).
|
||||
|
||||
|
||||
* [How Weave Finds Containers]({{ '/tasks/weavedns/how-works-weavedns' | relative_url }})
|
||||
* [Load Balancing and Fault Resilience with WeaveDNS]({{ '/tasks/weavedns/load-balance-fault-weavedns' | relative_url }})
|
||||
* [Managing Domain Entries]({{ '/tasks/weavedns/managing-entries-weavedns' | relative_url }})
|
||||
@@ -0,0 +1,83 @@
|
||||
---
|
||||
title: Managing Domain Entries
|
||||
menu_order: 40
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
The following topics are discussed:
|
||||
|
||||
* [Adding and removing extra DNS entries](#add-remove)
|
||||
* [Resolving WeaveDNS entries from the Host](#resolve-weavedns-entries-from-host)
|
||||
* [Hot-swapping Service Containers](#hot-swapping)
|
||||
* [Configuring a Custom TTL](#ttl)
|
||||
|
||||
### <a name="add-remove"></a>Adding and Removing Extra DNS Entries
|
||||
|
||||
If you want to give the container a name in DNS *other* than its
|
||||
hostname, you can register it using the `dns-add` command. For example:
|
||||
|
||||
```
|
||||
$ C=$(docker run -ti weaveworks/ubuntu)
|
||||
$ weave dns-add $C -h pingme2.weave.local
|
||||
```
|
||||
|
||||
You can also use `dns-add` to add the container's configured hostname
|
||||
and domain simply by omitting `-h <fqdn>`, or specify additional IP
|
||||
addresses to be registered against the container's hostname e.g.
|
||||
`weave dns-add 10.2.1.27 $C`.
|
||||
|
||||
The inverse operation can be carried out using the `dns-remove`
|
||||
command:
|
||||
|
||||
```
|
||||
$ weave dns-remove $C
|
||||
```
|
||||
|
||||
By omitting the container name it is possible to add/remove DNS
|
||||
records that associate names in the weaveDNS domain with IP addresses
|
||||
that do not belong to containers, e.g. non-weave addresses of external
|
||||
services:
|
||||
```
|
||||
$ weave dns-add 192.128.16.45 -h db.weave.local
|
||||
```
|
||||
|
||||
Note that such records get removed when stopping the weave peer on
|
||||
which they were added.
|
||||
|
||||
### <a name="resolve-weavedns-entries-from-host"></a>Resolving WeaveDNS Entries From the Host
|
||||
|
||||
You can resolve entries from any host running weaveDNS with `weave
|
||||
dns-lookup`:
|
||||
|
||||
host1$ weave dns-lookup pingme
|
||||
10.40.0.1
|
||||
|
||||
### <a name="hot-swapping"></a>Hot-swapping service containers
|
||||
|
||||
If you would like to deploy a new version of a service, keep the old
|
||||
one running because it has active connections but make all new
|
||||
requests go to the new version, then you can simply start the new
|
||||
server container and then [remove](#add-remove) the entry for the old
|
||||
server container. Later, when all connections to the old server have
|
||||
terminated, stop the container as normal.
|
||||
|
||||
### <a name="ttl"></a>Configuring a custom TTL
|
||||
|
||||
By default, weaveDNS specifies a TTL of 30 seconds in responses to DNS
|
||||
requests. However, you can force a different TTL value by launching
|
||||
weave with the `--dns-ttl` argument:
|
||||
|
||||
```
|
||||
$ weave launch --dns-ttl=10
|
||||
```
|
||||
|
||||
This will shorten the lifespan of answers sent to clients, so you will
|
||||
be effectively reducing the probability of them having stale
|
||||
information, but you will also be increasing the number of request this
|
||||
weaveDNS instance will receive.
|
||||
|
||||
**See Also**
|
||||
|
||||
* [How Weave Finds Containers]({{ '/tasks/weavedns/how-works-weavedns' | relative_url }})
|
||||
* [Load Balancing and Fault Resilience with WeaveDNS]({{ '/tasks/weavedns/load-balance-fault-weavedns' | relative_url }})
|
||||
* [Managing Domains]({{ '/tasks/weavedns/managing-domains-weavedns' | relative_url }})
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
title: Troubleshooting and Present Limitations
|
||||
menu_order: 50
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
### <a name="troubleshooting"></a>Troubleshooting
|
||||
|
||||
The command:
|
||||
|
||||
weave status
|
||||
|
||||
reports on the current status of various Weave Net components, including
|
||||
DNS:
|
||||
|
||||
```
|
||||
...
|
||||
Service: dns
|
||||
Domain: weave.local.
|
||||
Upstream: 8.8.8.8, 8.8.4.4
|
||||
TTL: 1
|
||||
Entries: 9
|
||||
...
|
||||
```
|
||||
|
||||
The first section covers the router; see the [troubleshooting
|
||||
guide]({{ '/troubleshooting#weave-status' | relative_url }}) for more details.
|
||||
|
||||
The 'Service: dns' section is pertinent to weaveDNS, and includes:
|
||||
|
||||
* The local domain suffix which is being served
|
||||
* The list of upstream servers used for resolving names not in the local domain
|
||||
* The response ttl
|
||||
* The total number of entries
|
||||
|
||||
You may also use `weave status dns` to obtain a [complete
|
||||
dump]({{ '/troubleshooting#weave-status-dns' | relative_url }}) of all DNS registrations.
|
||||
|
||||
Information on the processing of queries, and the general operation of
|
||||
weaveDNS, can be obtained from the container logs with
|
||||
|
||||
docker logs weave
|
||||
|
||||
### <a name="limitations"></a>Present Limitations
|
||||
|
||||
* The server will not know about restarted containers, but if you
|
||||
re-attach a restarted container to the weave network, it will be
|
||||
re-registered with weaveDNS.
|
||||
* The server may give unreachable IPs as answers, since it doesn't
|
||||
try to filter by reachability. If you use subnets, align your
|
||||
hostnames with the subnets.
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: Discovering Containers with WeaveDNS
|
||||
menu_order: 5
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
|
||||
|
||||
WeaveDNS is a DNS server that answers name queries on a Weave network
|
||||
and provides a simple way for containers to find each other. Just give
|
||||
the containers hostnames and then tell other containers to connect to
|
||||
those names. Unlike Docker 'links', this requires no code changes and
|
||||
it works across hosts.
|
||||
|
||||
WeaveDNS is deployed as an embedded service within the Weave router.
|
||||
The service is automatically started when the router is launched:
|
||||
|
||||
```
|
||||
host1$ weave launch
|
||||
host1$ eval $(weave env)
|
||||
```
|
||||
|
||||
WeaveDNS related configuration arguments can be passed to `launch`.
|
||||
|
||||
Application containers use weaveDNS automatically if it is
|
||||
running when they are started. They use it for name
|
||||
resolution, and will register themselves if they either have a
|
||||
hostname in the weaveDNS domain (`weave.local` by default) or are given an explicit container name:
|
||||
|
||||
```
|
||||
host1$ docker run -dti --name=pingme weaveworks/ubuntu
|
||||
host1$ docker run -ti --hostname=ubuntu.weave.local weaveworks/ubuntu
|
||||
root@ubuntu:/# ping pingme
|
||||
...
|
||||
```
|
||||
|
||||
Moreover, weaveDNS always register all network aliases (--network-alias option to docker run).
|
||||
|
||||
```
|
||||
host1$ docker run --network weave --network-alias pingme --network-alias pingme2 -dti weaveworks/ubuntu
|
||||
host1$ docker run --network weave --hostname=ubuntu.weave.local -ti weaveworks/ubuntu
|
||||
root@ubuntu:/# ping pingme
|
||||
...
|
||||
root@ubuntu:/# ping pingme2
|
||||
...
|
||||
```
|
||||
|
||||
> **Note** If both hostname and container name are specified at
|
||||
the same time, the hostname takes precedence. In this circumstance, if
|
||||
the hostname is not in the weaveDNS domain, the container is *not*
|
||||
registered, but it will still use weaveDNS for resolution.
|
||||
|
||||
By default, weaveDNS will listen on port 53 on the address of the
|
||||
Docker bridge. To make it listen on a different address or port use
|
||||
`weave launch --dns-listen-address <address>:<port>`
|
||||
|
||||
To disable an application container's use of weaveDNS, add the
|
||||
`--without-dns` option to `weave launch`. To
|
||||
disable weaveDNS itself, launch weave with the `--no-dns` option.
|
||||
|
||||
> **Note** WeaveDNS is not part of the Weave Net Kubernetes add-on.
|
||||
Kubernetes has its own DNS service, integrated with Kubernetes
|
||||
Services, and WeaveDNS does not duplicate that functionality.
|
||||
|
||||
**See Also**
|
||||
|
||||
* [Integrating Docker via the API Proxy]({{ '/tasks/weave-docker-api/weave-docker-api' | relative_url }})
|
||||
* [Load Balancing and Fault Resilience with WeaveDNS]({{ '/tasks/weavedns/load-balance-fault-weavedns' | relative_url }})
|
||||
Reference in new issue
Block a user