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:
parent
74f9dc6c00
commit
ae9cae67e3
11 changed files with 56 additions and 38 deletions
|
@ -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
|
||||
notifies to 10.240.1.1
|
||||
|
||||
~~~
|
||||
auto org {
|
||||
directory /etc/coredns/zones/org
|
||||
transfer to *
|
||||
transfer to 10.240.1.1
|
||||
~~~ corefile
|
||||
. {
|
||||
auto org {
|
||||
directory /etc/coredns/zones/org
|
||||
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`,
|
||||
where `example.org` is the origin. Scan every 45 seconds.
|
||||
|
||||
~~~
|
||||
auto org {
|
||||
directory /etc/coredns/zones/org www\.db\.(.*) {1} 45
|
||||
~~~ corefile
|
||||
org {
|
||||
auto {
|
||||
directory /etc/coredns/zones/org www\.db\.(.*) {1} 45
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
|
|
@ -17,6 +17,8 @@ bind ADDRESS
|
|||
|
||||
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
|
||||
}
|
||||
~~~
|
||||
|
|
8
plugin/cache/README.md
vendored
8
plugin/cache/README.md
vendored
|
@ -62,7 +62,9 @@ cache 10
|
|||
|
||||
Proxy to Google Public DNS and only cache responses for example.org (or below).
|
||||
|
||||
~~~
|
||||
proxy . 8.8.8.8:53
|
||||
cache example.org
|
||||
~~~ corefile
|
||||
. {
|
||||
proxy . 8.8.8.8:53
|
||||
cache example.org
|
||||
}
|
||||
~~~
|
||||
|
|
|
@ -15,6 +15,8 @@ debug
|
|||
|
||||
Disable CoreDNS' ability to recover from crashes:
|
||||
|
||||
~~~ txt
|
||||
debug
|
||||
~~~ corefile
|
||||
. {
|
||||
debug
|
||||
}
|
||||
~~~
|
||||
|
|
|
@ -27,8 +27,8 @@ erratic {
|
|||
|
||||
## Examples
|
||||
|
||||
~~~ txt
|
||||
.:53 {
|
||||
~~~ corefile
|
||||
. {
|
||||
erratic {
|
||||
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.
|
||||
|
||||
~~~ txt
|
||||
~~~ corefile
|
||||
. {
|
||||
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
|
||||
|
||||
~~~ txt
|
||||
~~~ corefile
|
||||
. {
|
||||
erratic {
|
||||
delay 3 50ms
|
||||
|
@ -55,7 +55,7 @@ Delay 1 in 3 queries for 50ms
|
|||
|
||||
Delay 1 in 3 and truncate 1 in 5.
|
||||
|
||||
~~~ txt
|
||||
~~~ corefile
|
||||
. {
|
||||
erratic {
|
||||
delay 3 5ms
|
||||
|
@ -66,7 +66,7 @@ Delay 1 in 3 and truncate 1 in 5.
|
|||
|
||||
Drop every second query.
|
||||
|
||||
~~~ txt
|
||||
~~~ corefile
|
||||
. {
|
||||
erratic {
|
||||
drop 2
|
||||
|
|
|
@ -50,8 +50,8 @@ etcd [ZONES...] {
|
|||
|
||||
This is the default SkyDNS setup, with everying specified in full:
|
||||
|
||||
~~~
|
||||
.:53 {
|
||||
~~~ corefile
|
||||
. {
|
||||
etcd skydns.local {
|
||||
stubzones
|
||||
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
|
||||
when resolving external pointing CNAMEs.
|
||||
|
||||
~~~
|
||||
.:53 {
|
||||
~~~ corefile
|
||||
. {
|
||||
etcd skydns.local {
|
||||
path /skydns
|
||||
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:
|
||||
|
||||
~~~
|
||||
etcd skydns.local 0.0.10.in-addr.arpa {
|
||||
stubzones
|
||||
...
|
||||
etcd skydns.local 0.0.10.in-addr.arpa {
|
||||
stubzones
|
||||
...
|
||||
~~~
|
||||
|
||||
Next you'll need to populate the zone with reverse records, here we add a reverse for
|
||||
|
|
|
@ -20,9 +20,9 @@ federation [ZONES...] {
|
|||
|
||||
Here we handle all service requests in the `prod` and `stage` federations.
|
||||
|
||||
~~~ txt
|
||||
~~~
|
||||
. {
|
||||
kubernetes cluster.local
|
||||
kubernetes cluster.local
|
||||
federation cluster.local {
|
||||
prod prod.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:
|
||||
|
||||
~~~ txt
|
||||
~~~
|
||||
cluster.local {
|
||||
kubernetes
|
||||
federation {
|
||||
|
|
|
@ -43,8 +43,10 @@ is `localhost:9153`. The metrics path is fixed to `/metrics`.
|
|||
|
||||
Use an alternative address:
|
||||
|
||||
~~~
|
||||
prometheus localhost:9253
|
||||
~~~ corefile
|
||||
. {
|
||||
prometheus localhost:9253
|
||||
}
|
||||
~~~
|
||||
|
||||
# Bugs
|
||||
|
|
|
@ -31,7 +31,9 @@ pprof
|
|||
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:
|
||||
|
|
|
@ -17,6 +17,8 @@ root PATH
|
|||
|
||||
Serve zone data (when the *file* plugin is used) from `/etc/coredns/zones`:
|
||||
|
||||
~~~ txt
|
||||
root /etc/coredns/zones
|
||||
~~~ corefile
|
||||
. {
|
||||
root /etc/coredns/zones
|
||||
}
|
||||
~~~
|
||||
|
|
|
@ -51,8 +51,10 @@ trace tracinghost:9253
|
|||
|
||||
or
|
||||
|
||||
~~~
|
||||
trace zipkin tracinghost:9253
|
||||
~~~ corefile
|
||||
. {
|
||||
trace zipkin tracinghost:9253
|
||||
}
|
||||
~~~
|
||||
|
||||
If for some reason you are using an API reverse proxy or something and need to remap
|
||||
|
|
Loading…
Add table
Reference in a new issue