Commit ae9cae67 authored by Miek Gieben's avatar Miek Gieben Committed by GitHub

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 :(
parent 74f9dc6c
...@@ -50,19 +50,23 @@ directive only is authoritative for `example.ORG`. ...@@ -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 { . {
auto org {
directory /etc/coredns/zones/org directory /etc/coredns/zones/org
transfer to * transfer to *
transfer to 10.240.1.1 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 {
auto {
directory /etc/coredns/zones/org www\.db\.(.*) {1} 45 directory /etc/coredns/zones/org www\.db\.(.*) {1} 45
}
} }
~~~ ~~~
...@@ -17,6 +17,8 @@ bind ADDRESS ...@@ -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
}
~~~ ~~~
...@@ -62,7 +62,9 @@ cache 10 ...@@ -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
}
~~~ ~~~
...@@ -15,6 +15,8 @@ debug ...@@ -15,6 +15,8 @@ debug
Disable CoreDNS' ability to recover from crashes: Disable CoreDNS' ability to recover from crashes:
~~~ txt ~~~ corefile
debug . {
debug
}
~~~ ~~~
...@@ -27,8 +27,8 @@ erratic { ...@@ -27,8 +27,8 @@ erratic {
## Examples ## Examples
~~~ txt ~~~ corefile
.:53 { . {
erratic { erratic {
drop 3 drop 3
} }
...@@ -37,7 +37,7 @@ erratic { ...@@ -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 ...@@ -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 ...@@ -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. ...@@ -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
......
...@@ -50,8 +50,8 @@ etcd [ZONES...] { ...@@ -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: ...@@ -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 ...@@ -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
......
...@@ -20,7 +20,7 @@ federation [ZONES...] { ...@@ -20,7 +20,7 @@ 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 {
...@@ -32,7 +32,7 @@ Here we handle all service requests in the `prod` and `stage` federations. ...@@ -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 {
......
...@@ -43,8 +43,10 @@ is `localhost:9153`. The metrics path is fixed to `/metrics`. ...@@ -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
......
...@@ -31,7 +31,9 @@ pprof ...@@ -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:
......
...@@ -17,6 +17,8 @@ root PATH ...@@ -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
}
~~~ ~~~
...@@ -51,8 +51,10 @@ trace tracinghost:9253 ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment