2016-03-20 17:44:58 +00:00
|
|
|
# etcd
|
|
|
|
|
|
|
|
|
|
`etcd` enabled reading zone data from an etcd instance. The data in etcd has to be encoded as
|
|
|
|
|
a [message](https://github.com/skynetservices/skydns/blob/2fcff74cdc9f9a7dd64189a447ef27ac354b725f/msg/service.go#L26)
|
2016-04-16 16:16:52 +01:00
|
|
|
like [SkyDNS](https//github.com/skynetservices/skydns). It should also work just like SkyDNS.
|
2016-03-20 21:36:55 +00:00
|
|
|
|
2016-04-16 16:16:52 +01:00
|
|
|
The etcd middleware makes extensive use of the proxy middleware to forward and query other servers
|
|
|
|
|
in the network.
|
2016-03-24 08:22:24 +00:00
|
|
|
|
2016-03-20 17:44:58 +00:00
|
|
|
## Syntax
|
|
|
|
|
|
|
|
|
|
~~~
|
2016-03-22 11:32:12 +00:00
|
|
|
etcd [zones...]
|
2016-03-20 17:44:58 +00:00
|
|
|
~~~
|
|
|
|
|
|
2016-03-25 20:26:42 +00:00
|
|
|
* `zones` zones etcd should be authoritative for.
|
2016-03-20 17:44:58 +00:00
|
|
|
|
2016-04-19 12:52:05 +00:00
|
|
|
The path will default to `/skydns` the local etcd proxy (http://localhost:2379).
|
2016-03-22 11:32:12 +00:00
|
|
|
If no zones are specified the block's zone will be used as the zone.
|
2016-03-20 17:44:58 +00:00
|
|
|
|
2016-03-24 17:55:46 +00:00
|
|
|
If you want to `round robin` A and AAAA responses look at the `loadbalance` middleware.
|
2016-03-20 21:36:55 +00:00
|
|
|
|
2016-03-20 17:44:58 +00:00
|
|
|
~~~
|
2016-03-25 20:26:42 +00:00
|
|
|
etcd [zones...] {
|
|
|
|
|
stubzones
|
2016-03-20 17:44:58 +00:00
|
|
|
path /skydns
|
2016-03-22 11:04:56 +00:00
|
|
|
endpoint endpoint...
|
2016-03-25 20:26:42 +00:00
|
|
|
upstream address...
|
|
|
|
|
tls cert key cacert
|
2016-03-20 17:44:58 +00:00
|
|
|
}
|
|
|
|
|
~~~
|
|
|
|
|
|
2016-04-16 16:16:52 +01:00
|
|
|
* `stubzones` enable the stub zones feature. The stubzone is *only* done in the etcd tree located
|
|
|
|
|
under the *first* zone specified.
|
2016-03-25 20:26:42 +00:00
|
|
|
* `path` the path inside etcd, defaults to "/skydns".
|
|
|
|
|
* `endpoint` the etcd endpoints, default to "http://localhost:2397".
|
2016-04-16 16:16:52 +01:00
|
|
|
* `upstream` upstream resolvers to be used resolve external names found in etcd, think CNAMEs
|
|
|
|
|
pointing to external names. If you want CoreDNS to act as a proxy for clients you'll need to add
|
|
|
|
|
the proxy middleware.
|
2016-03-26 16:32:36 +00:00
|
|
|
* `tls` followed the cert, key and the CA's cert filenames.
|
2016-03-20 18:17:07 +00:00
|
|
|
|
2016-03-20 17:44:58 +00:00
|
|
|
## Examples
|
2016-04-16 16:16:52 +01:00
|
|
|
|
|
|
|
|
This is the default SkyDNS setup, with everying specified in full:
|
|
|
|
|
|
|
|
|
|
~~~
|
|
|
|
|
.:53 {
|
2016-04-19 12:52:05 +00:00
|
|
|
etcd skydns.local {
|
2016-04-16 16:16:52 +01:00
|
|
|
stubzones
|
|
|
|
|
path /skydns
|
2016-04-19 12:52:05 +00:00
|
|
|
endpoint http://localhost:2379
|
2016-04-16 16:16:52 +01:00
|
|
|
upstream 8.8.8.8:53 8.8.4.4:53
|
|
|
|
|
}
|
2016-04-19 12:52:05 +00:00
|
|
|
prometheus
|
|
|
|
|
cache 160 skydns.local
|
2016-04-16 16:16:52 +01:00
|
|
|
loadbalance
|
|
|
|
|
proxy . 8.8.8.8:53 8.8.4.4:53
|
|
|
|
|
}
|
|
|
|
|
~~~
|