Restructure docs

This commit is contained in:
Adam Harrison committed 2016-04-07 10:37:57 +01:00
1 parent 21d061fa44
commit 80770cc96e
50 files changed
+51 -50

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
---
title: How Weave Finds Containers
layout: default
menu_order: 10
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: Load Balancing and Fault Resilience with weaveDNS
layout: default
menu_order: 20
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: Managing Domains
layout: default
menu_order: 30
---
The following topics are discussed:
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: Managing Domain Entries
layout: default
menu_order: 40
---
-48
View File
@@ -1,48 +0,0 @@
---
title: Using WeaveDNS
layout: default
---
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:
```bash
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:
```bash
host1$ docker run -dti --name=pingme ubuntu
host1$ docker run -ti --hostname=ubuntu.weave.local ubuntu
root@ubuntu:/# ping pingme
...
```
> **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.
To disable an application container's use of weaveDNS, add the
`--without-dns` option to `weave run` or `weave launch-proxy`. To
disable weaveDNS itself, launch weave with the `--no-dns` option.
**See Also**
* [How Weave Finds Containers](/site/weave-docker-api/how-works-weavedns.md)
* [Load Balancing and Fault Resilience with WeaveDNS](/site/weave-docker-api/load-balance-fault-weavedns.md)
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: Troubleshooting and Present Limitations
layout: default
menu_order: 50
---
+83
View File
@@ -0,0 +1,83 @@
---
title: WeaveDNS (service discovery) Design Notes
layout: default
---
# WeaveDNS (service discovery) Design Notes
The model is that each host has a service that is notified of
hostnames and weave addresses for containers on the host. Like IPAM,
this service is embedded within the router. It binds to
the host bridge to answer DNS queries from local containers; for
anything it can't answer, it uses the information in the host's
/etc/resolv.conf to query an 'fallback' server.
The service is comprised of a DNS server, which answers all DNS queries
from containers, and a in-memory database of hostnames and IPs. The
database on each node contains a complete copy of the hostnames and IPs
for every containers in the cluster.
For hostname queries in the local domain (default weave.local), the DNS
server will consult the in-memory database. For reverse queries, we
first consult the local database, and if not found we query the
upstream server. For all other queries, we consult the upstream
server.
Updates to the in-memory database are broadcast to other DNS servers
within the cluster. The in-memory database only contains entries from
connected DNS servers; if a DNS server becomes partitioned from the
cluster, entries belonging to that server are removed from each node in
the cluster. When the partitioned DNS server reconnects, the entries
are re-broadcast around the cluster.
The DNS server also listens to the Docker event stream, and removes
entries for containers when they die. Entries removed in this way are
tombstoned, and the tombstone lazily broadcast around the cluster.
After a short timeout the tombstones are independently removed from
each host.
## DNS server API
The DNS server accepts HTTP requests on the following URL (patterns)
and methods:
`PUT /name/<identifier>/<ip-address>`
Put a record for an IP, bound to a host-scoped identifier (e.g., a
container ID), in the DNS database. The request body must contain
a `fqdn=foo.weave.local` key pair.
`DELETE /name/<identifier>/<ip-address>`
Remove a specific record for an IP and host-scoped identifier. The request
body can optionally contain a `fqdn=foo.weave.local` key pair.
`DELETE /name/<identifier>`
Remove all records for the host-scoped identifier.
`GET /name/<fqdn>`
List of all IPs (in JSON format) for givne FQDN.
## DNS updater
The updater component uses the Docker remote API to monitor containers
coming and going, and tells the DNS server to update its records via
its HTTP interface. It does not need to be attached to the weave
network.
The updater starts by subscribing to the events, and getting a list of
the current containers. Any containers given a domain ending with
".weave" are considered for inclusion in the name database.
When it sees a container start or stop, the updater checks the weave
network attachment of the container, and updates the DNS server.
> How does it check the network attachment from within a container?
> Will it need to delay slightly so that `attach` has a chance to run?
> Perhaps it could put containers on a watch list when it's noticed
> them.