plugins: expand examples (#1077)

* plugins: expand examples

Expand some examples and test them by annotating it with `corefile`

* Can't start kubernetes

* Can test pprof :(
This commit is contained in:
Miek Gieben 2017-09-15 09:56:05 +01:00 committed by GitHub
parent 74f9dc6c00
commit ae9cae67e3
11 changed files with 56 additions and 38 deletions

View file

@ -50,19 +50,23 @@ directive only is authoritative for `example.ORG`.
Load `org` domains from `/etc/coredns/zones/org` and allow transfers to the internet, but send Load `org` domains from `/etc/coredns/zones/org` and allow transfers to the internet, but send
notifies to 10.240.1.1 notifies to 10.240.1.1
~~~ ~~~ corefile
auto org { . {
directory /etc/coredns/zones/org auto org {
transfer to * directory /etc/coredns/zones/org
transfer to 10.240.1.1 transfer to *
transfer to 10.240.1.1
}
} }
~~~ ~~~
Load `org` domains from `/etc/coredns/zones/org` and looks for file names as `www.db.example.org`, Load `org` domains from `/etc/coredns/zones/org` and looks for file names as `www.db.example.org`,
where `example.org` is the origin. Scan every 45 seconds. where `example.org` is the origin. Scan every 45 seconds.
~~~ ~~~ corefile
auto org { org {
directory /etc/coredns/zones/org www\.db\.(.*) {1} 45 auto {
directory /etc/coredns/zones/org www\.db\.(.*) {1} 45
}
} }
~~~ ~~~

View file

@ -17,6 +17,8 @@ bind ADDRESS
To make your socket accessible only to that machine, bind to IP 127.0.0.1 (localhost): To make your socket accessible only to that machine, bind to IP 127.0.0.1 (localhost):
~~~ txt ~~~
bind 127.0.0.1 . {
bind 127.0.0.1
}
~~~ ~~~

View file

@ -62,7 +62,9 @@ cache 10
Proxy to Google Public DNS and only cache responses for example.org (or below). Proxy to Google Public DNS and only cache responses for example.org (or below).
~~~ ~~~ corefile
proxy . 8.8.8.8:53 . {
cache example.org proxy . 8.8.8.8:53
cache example.org
}
~~~ ~~~

View file

@ -15,6 +15,8 @@ debug
Disable CoreDNS' ability to recover from crashes: Disable CoreDNS' ability to recover from crashes:
~~~ txt ~~~ corefile
debug . {
debug
}
~~~ ~~~

View file

@ -27,8 +27,8 @@ erratic {
## Examples ## Examples
~~~ txt ~~~ corefile
.:53 { . {
erratic { erratic {
drop 3 drop 3
} }
@ -37,7 +37,7 @@ erratic {
Or even shorter if the defaults suits you. Note this only drops queries, it does not delay them. Or even shorter if the defaults suits you. Note this only drops queries, it does not delay them.
~~~ txt ~~~ corefile
. { . {
erratic erratic
} }
@ -45,7 +45,7 @@ Or even shorter if the defaults suits you. Note this only drops queries, it does
Delay 1 in 3 queries for 50ms Delay 1 in 3 queries for 50ms
~~~ txt ~~~ corefile
. { . {
erratic { erratic {
delay 3 50ms delay 3 50ms
@ -55,7 +55,7 @@ Delay 1 in 3 queries for 50ms
Delay 1 in 3 and truncate 1 in 5. Delay 1 in 3 and truncate 1 in 5.
~~~ txt ~~~ corefile
. { . {
erratic { erratic {
delay 3 5ms delay 3 5ms
@ -66,7 +66,7 @@ Delay 1 in 3 and truncate 1 in 5.
Drop every second query. Drop every second query.
~~~ txt ~~~ corefile
. { . {
erratic { erratic {
drop 2 drop 2

View file

@ -50,8 +50,8 @@ etcd [ZONES...] {
This is the default SkyDNS setup, with everying specified in full: This is the default SkyDNS setup, with everying specified in full:
~~~ ~~~ corefile
.:53 { . {
etcd skydns.local { etcd skydns.local {
stubzones stubzones
path /skydns path /skydns
@ -68,8 +68,8 @@ This is the default SkyDNS setup, with everying specified in full:
Or a setup where we use `/etc/resolv.conf` as the basis for the proxy and the upstream Or a setup where we use `/etc/resolv.conf` as the basis for the proxy and the upstream
when resolving external pointing CNAMEs. when resolving external pointing CNAMEs.
~~~ ~~~ corefile
.:53 { . {
etcd skydns.local { etcd skydns.local {
path /skydns path /skydns
upstream /etc/resolv.conf upstream /etc/resolv.conf
@ -88,9 +88,9 @@ need to add the zone `0.0.10.in-addr.arpa` to the list of zones. (The fun starts
in the ip6.arpa domain.) Showing a snippet of a Corefile: in the ip6.arpa domain.) Showing a snippet of a Corefile:
~~~ ~~~
etcd skydns.local 0.0.10.in-addr.arpa { etcd skydns.local 0.0.10.in-addr.arpa {
stubzones stubzones
... ...
~~~ ~~~
Next you'll need to populate the zone with reverse records, here we add a reverse for Next you'll need to populate the zone with reverse records, here we add a reverse for

View file

@ -20,9 +20,9 @@ federation [ZONES...] {
Here we handle all service requests in the `prod` and `stage` federations. Here we handle all service requests in the `prod` and `stage` federations.
~~~ txt ~~~
. { . {
kubernetes cluster.local kubernetes cluster.local
federation cluster.local { federation cluster.local {
prod prod.feddomain.com prod prod.feddomain.com
staging staging.feddomain.com staging staging.feddomain.com
@ -32,7 +32,7 @@ Here we handle all service requests in the `prod` and `stage` federations.
Or slightly shorter: Or slightly shorter:
~~~ txt ~~~
cluster.local { cluster.local {
kubernetes kubernetes
federation { federation {

View file

@ -43,8 +43,10 @@ is `localhost:9153`. The metrics path is fixed to `/metrics`.
Use an alternative address: Use an alternative address:
~~~ ~~~ corefile
prometheus localhost:9253 . {
prometheus localhost:9253
}
~~~ ~~~
# Bugs # Bugs

View file

@ -31,7 +31,9 @@ pprof
Listen on an alternate address: Listen on an alternate address:
~~~ ~~~
pprof 10.9.8.7:6060 . {
pprof 10.9.8.7:6060
}
~~~ ~~~
Listen on an all addresses on port 6060: Listen on an all addresses on port 6060:

View file

@ -17,6 +17,8 @@ root PATH
Serve zone data (when the *file* plugin is used) from `/etc/coredns/zones`: Serve zone data (when the *file* plugin is used) from `/etc/coredns/zones`:
~~~ txt ~~~ corefile
root /etc/coredns/zones . {
root /etc/coredns/zones
}
~~~ ~~~

View file

@ -51,8 +51,10 @@ trace tracinghost:9253
or or
~~~ ~~~ corefile
trace zipkin tracinghost:9253 . {
trace zipkin tracinghost:9253
}
~~~ ~~~
If for some reason you are using an API reverse proxy or something and need to remap If for some reason you are using an API reverse proxy or something and need to remap