Commit graph

1250 commits

Author SHA1 Message Date
Erfan Besharat
baaa834dc1 plugin/acl: document metrics in README (#3605)
Signed-off-by: Erfan Besharat <erbesharat@gmail.com>
2020-01-18 16:46:57 +01:00
Miek Gieben
5f159ca464 gofmt -w -s **/*.go (#3603)
format and remove trailing white space; makes 'make presubmit' pass
again.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-17 10:47:45 -05:00
Miek Gieben
c95faea624
docs: update README and log plugin (#3602)
README: remove the logo thing as we stopped doing that
log: remote the lines about the clock output as that's gone as well and
     discuss the query log vs other logging a bit.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-17 16:16:29 +01:00
Brad P. Crochet
aa8c325d4a Fix HostPortOrFile to support IPv6 addresses with zone (#3527)
1. The HostPortOrFile tests don't have any IPv6 tests. This adds some.
2. The HostPortOrFile breaks if any of the addresses have IPv6 zone
defined. ParseIP does not handle %zone anymore.

Signed-off-by: Brad P. Crochet <brad@redhat.com>
2020-01-16 20:47:39 +01:00
Miek Gieben
2221b6160c sign: add expiration jitter (#3588)
* add expiration jitter

Signed-off-by: Miek Gieben <miek@miek.nl>

* sign: add expiration jitter

This PR adds a expiration jitter to spread out zone re-signing even
more. The max is 5 extra days added when creating the signer for a
specific zone.

Also make the duration* constants private to clean up the godoc for this
plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-12 04:56:57 -08:00
Zheng Xie
f81f28d97b plugin/cache: update comment to conform to the implementation (#3573)
Signed-off-by: zheng xie <xiez1989@gmail.com>
2020-01-03 14:26:53 +01:00
Jonathan Nagy
e3266d24f7 Resolve TXT records via CNAME (#3557)
* Add test case for TXT lookup via CNAME

Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>

* Return HostType of explicit TXT records

Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>

* Adapt TXT method lookup to allow lookup via CNAME

Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>

* Implement lookup of TXT records via CNAME

Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>
2020-01-03 14:16:04 +01:00
Zou Nengren
99e7c3dee7 registry cache_miss logic (#3578)
Signed-off-by: zouyee <zounyee1989@gmail.com>
2020-01-03 10:06:37 +01:00
Miek Gieben
fc546cf129
doc: fix generated manual pages (#3571)
Went over all generated manual pages and fixed some markdown issues,
mostly escaping "_" to avoid underlining entire paragraphs.

Some textual fixes in route53 and other cloud DNS plugins.

Regenerated the markdown with mmark.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-12-29 13:35:17 +01:00
Antonio Ojea
e1cf9ccdab Bump kubernetes plugin schema version (#3554)
The Kubernetes DNS specification schema version was
updated to 1.1.0 in order to support IPv6

Signed-off-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
2019-12-19 09:34:03 -05:00
Zou Nengren
dded126317 bump k8s releated library (#3552)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
2019-12-18 05:32:00 -08:00
Zou Nengren
5e04c27238 Dedup policy implement between grpc and proxy plugin (#3537)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
2019-12-17 08:15:31 +00:00
Yong Tang
a34d564c07 Remove trailing whitespace as otherwise make check fails (#3515)
This PR removes trailing whitespace as otherwise `make check` fails

This PR fixes 3513

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-12-07 15:47:18 +00:00
Miek Gieben
a53321d9d6
plugin/sign: fix signing of authoritative data (#3479)
Don't sign data we are not authoritative for. This adds an AuthWalk
which skips names we should not authoritative for. Adds a few tests to
check this is the case. Generates zones have been compared to
dnssec-signzone.

A number of changes have been made:

* don't add DS records to the apex
* NSEC TTL is the SOA's minttl value (copying bind9)
* Various cleanups
* signer struct was cleaned up: doesn't need ttl, nor expiration or
  inception.
* plugin/sign: remove apex stuff from names()
  This is never used because we will always have other types in the
  apex, because we *ADD* them ourselves, before we sign (DNSKEY, CDS and
  CDNSKEY).

Signed-off-by: Miek Gieben <miek@miek.nl>
Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
2019-12-06 19:54:31 +00:00
Zou Nengren
799dce4bff redirect handler for pprof index (#3503)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
2019-12-06 19:04:49 +00:00
Zou Nengren
13fca02316 use pkg/reuseport in rest plugins (#3492)
Automatically submitted.
2019-12-06 10:55:40 +00:00
Gonzalo Paniagua Javier
b4df2d0d4c Add a serve_stale option for plugin/cache (#3468)
Automatically submitted.
2019-11-29 15:17:50 +00:00
Miek Gieben
24176a97e6
Move to CODEOWNERS (#3489)
* Move to CODEOWNERS

No change in who own what; just a move to CODEOWNERS. This allows
dreck cleanups.

Added .dreck.yaml for alias and exec.

Fixes: #3486

Signed-off-by: Miek Gieben <miek@miek.nl>

* stickler bot

Signed-off-by: Miek Gieben <miek@miek.nl>

* sort the file

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-29 13:17:05 +00:00
Zou Nengren
768ca99c57 Fix reloading in health and ready (#3473)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
2019-11-20 12:14:37 +00:00
Gonzalo Paniagua Javier
f91c55d6cd Fix reloading in plugin/pprof. (#3454)
* Fix reloading in plugin/pprof.

Reloading the server without changing the listen address results in an
error because Startup is called for newly set up plugins before Shutdown
is called for the old ones.

Signed-off-by: Gonzalo Paniagua Javier <gonzalo.mono@gmail.com>

* Use pkg/reuseport when listening.

Use coredns' newly added reuseport.

Signed-off-by: Gonzalo Paniagua Javier <gonzalo.mono@gmail.com>

* Revert go.{mod,sum} changes.

Signed-off-by: Gonzalo Paniagua Javier <gonzalo.mono@gmail.com>
2019-11-18 07:58:00 +00:00
Yong Tang
f100d61183 Fix incorrect sample configuration in clouddns (#3457)
Automatically submitted.
2019-11-17 18:53:10 +00:00
Miek Gieben
e14e053d3d create pkg/reuseport (#3455)
* create pkg/reuseport

Move the core server listening functions to a new package so plugins can
use them.

Also make *all* servers use the functions here; as only the udp/tcp
listeners where using SO_REUSEPORT (if available). This is the only
actual change in this PR; in it's core it's just a move of 2 files.

This can also be used to cleanup the dance we're doing now for
re-acquiring the sockets in e.g. the metrics plugins and the ready
plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Also push a small doc update

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-16 18:02:46 -08:00
Miek Gieben
4831e7f947 bufsize: go gen and docs (#3449)
Run 'go generate' and 'make -f Makefile.doc' to generate the chaos
plugin author list and update the manual pages.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-15 07:45:09 -08:00
Miek Gieben
1e3330c12b pkg/fall: add (a lot of) guidance (#3450)
update the pkg doc to talk about various trade off

Fixes #2723

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-15 09:14:29 -05:00
Chris O'Haver
672992751e plugin/bufsize: remove trailing whitespace (#3444) 2019-11-14 16:13:49 +00:00
Kohei Yoshida
8cc034eece plugin/bufsize: add usecase description (#3437)
* add usecase

Signed-off-by: yukihira <yukihira.lab@gmail.com>

* fix some comments

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>
2019-11-14 07:37:45 +00:00
Kohei Yoshida
1743ca3f02 add OWNERS file (#3441)
Signed-off-by: yukihira <yukihira.lab@gmail.com>
2019-11-13 09:49:24 +00:00
Kohei Yoshida
e23a34abb4 Add bufsize plugin for preparing the DNS Flag Day and avoiding IP fragmentation (#3401)
* add bufsize plugin

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* add docstring and comment

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* delete stdout messages when get an error

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* change to context.Background from TODO

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* define default bufsize as defaultBufSize constant

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* fix some comments

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* function name change: parse

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* function name change: parse

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>
2019-11-10 08:10:12 +00:00
Guangming Wang
113783ed91 Call wg.Add in main goroutine to avoid race conditons. (#3433)
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-11-07 15:29:50 +00:00
Miciah Dashiel Butler Masters
1942746c48 plugin/reload: Fix "durations" documentation link (#3431)
* plugin/reload/README.md: Fix the syntax of the link to the Go
documentation for duration values.

Signed-off-by: Miciah Dashiel Butler Masters <mmasters@redhat.com>
2019-11-06 13:27:55 -08:00
Miek Gieben
5ecd4ec57a transfer: small doc update (#3426)
Tweak the README a little. Name and spell out axfr/ixfr.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-05 10:57:22 -05:00
Chris O'Haver
a7ab592e78
plugin/transfer: Zone transfer plugin (#3223)
* transfer plugin

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2019-11-01 12:02:43 -04:00
Euan Kemp
431c70e8b9 Correct some if/iff mixups (#3406)
This is a fixup for https://github.com/coredns/coredns/pull/3310 which
replaced some 'iff's with 'if' under the assumption they were typos.

I'm fairly confident they were "If and only if"
(https://en.wikipedia.org/wiki/If_and_only_if), which is commonly
shortened as "iff".

I've updated them to the full length 'if, and only if' for the sake of
readability.

Signed-off-by: Euan Kemp <euan@ngrok.com>
2019-10-29 09:38:56 -04:00
Dan Panzarella
1821d9cb7e small typo in autopath README so->to (#3408)
Automatically submitted.
2019-10-28 19:17:54 +00:00
Chris O'Haver
6f375cbbda add MustNormalize (#3385)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2019-10-19 08:08:14 +01:00
Miek Gieben
5f114d38ca
pkg/log: add Clear to stop debug logging (#3372)
When reloading we need to disable debug output when the debug plugin is
removed from the config file. Add a `Clear` function to pkg/log and use
it in the server server.

Add test case in pkg/log, for actuall check I manually checked the
output by sprinkling some debug statements in the startup and checking
with sending SIGUSR1.

Also clear up the comments in pkg/log to remove the text about time
stamping.

Fixes: #3035

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-17 15:53:11 +01:00
Sean Liao
9ccc736f68 plugin/dnssec, plugin/sign: ed25519 support (#3380)
* add ed25519 dnskey support

Signed-off-by: Sean Liao <seankhliao@gmail.com>

* fix ed25519 type assertion

Signed-off-by: Sean Liao <seankhliao@gmail.com>

* clean up whitespace

Signed-off-by: Sean Liao <seankhliao@gmail.com>
2019-10-16 07:32:11 +01:00
yuxiaobo96
bf356e79fc fix spelling mistakes (#3364)
Automatically submitted.
2019-10-09 07:24:18 +00:00
Miek Gieben
65458b2de2
Directive -> plugin (#3363)
Caught my eye, we name things directive still, esp when talking about
the prometheus *plugin*. Rename everything that needs to be plugin to
'plugin'. Also make sure Metrics is a H2 section (not H1).

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-08 10:20:48 +01:00
Miek Gieben
ffe6225ff6 kubernetes: brush up README, rename metric (#3360)
Other latency metrics have `_duration` in the name change this metric
to be in sync with the other ones.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-07 08:38:46 -07:00
janluk
d7cdb992b4 Measure and expose DNS programming latency from Kubernetes plugin. (#3171)
For now metric is measure only for headless services. Informer has been slighlty
refactored, so the code can measure latency without storing extra fields on
Endpoint struct.

Signed-off-by: Janek Łukaszewicz <janluk@google.com>

Suggestions from code review

Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
2019-10-04 16:48:43 +01:00
Miek Gieben
03ea2ae955
Make request.Request smaller (#3351)
* Make request.Request smaller

This makes the request struct smaller and removes the pointer to the do
boolean (tri-bool) as size == 0 will indicate if we have cached it.

Family can be a int8 because it only carries 3 values, Size itself is
just a uint16 under the covers.

This is a more comprehensive fix than #3292

Closes #3292

Signed-off-by: Miek Gieben <miek@miek.nl>

* cache: fix test

this now needs a valid response writter

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-04 09:44:58 +01:00
Miek Gieben
f8551df272
cache: move goroutine closure to separate function to save memory (#3353)
The goroutine closure was causing objects to be heap allocated.  Moving
it to a separate function fixes that.

```benchmark                                old ns/op     new ns/op     delta
BenchmarkCacheResponse/NoPrefetch-12     773           713           -7.76%
BenchmarkCacheResponse/Prefetch-12       878           837           -4.67%
BenchmarkHash-12                         9.17          9.18          +0.11%

benchmark                                old allocs     new allocs     delta
BenchmarkCacheResponse/NoPrefetch-12     9              8              -11.11%
BenchmarkCacheResponse/Prefetch-12       9              8              -11.11%
BenchmarkHash-12                         0              0              +0.00%

benchmark                                old bytes     new bytes     delta
BenchmarkCacheResponse/NoPrefetch-12     471           327           -30.57%
BenchmarkCacheResponse/Prefetch-12       471           327           -30.57%
BenchmarkHash-12                         0             0             +0.00%
```

Signed-off-by: Charlie Vieth <charlie.vieth@gmail.com>
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-03 15:05:44 +01:00
Miek Gieben
aa96d6b443
plugin/route53: remove amazon intialization from init (#3348)
Don't perform this code in the init, this allocated 1 megabyte of memory
even if you don't use the plugin. Looks to be only there for testing,
adding a comment to reflect that.

Fixes #3342

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-03 07:21:11 +01:00
Miek Gieben
8fde7407d9 plugin/clouddns: remove initialization from init (#3349)
* plugin/clouddns: remove initialization from init

Init should just call the plugin.Register with a setup function.

Fixes: #3343

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix placement for var f

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-02 15:18:36 -07:00
Yong Tang
d48d8516e3 Add clouddns/OWNERS file (#3346)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-10-02 07:42:29 +01:00
Miek Gieben
64f0345e63
plugin/erratic: doc and zone transfer (#3340)
Fix the documentation, remove autopath entry and fix the transfer by
copying some bits from the file plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-02 07:22:26 +01:00
Miek Gieben
575cea4496
Move map to array (#3339)
* Move map to array

The map was not needed move to an array, see #1941 for the original
idea. That of course didn't apply anymore; make a super minimal change
to implements the idea from #1941

Signed-off-by: Miek Gieben <miek@miek.nl>

* Add total count

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-01 20:45:52 +01:00
Miek Gieben
2d98d520b5
plugin/forward: make Yield not block (#3336)
* plugin/forward: may Yield not block

Yield may block when we're super busy with creating (and looking) for
connection. Set a small timeout on Yield, to skip putting the connection
back in the queue.

Use persistentConn troughout the socket handling code to be more
consistent.

Signed-off-by: Miek Gieben <miek@miek.nl>

Dont do

Signed-off-by: Miek Gieben <miek@miek.nl>

* Set used in Yield

This gives one central place where we update used in the persistConns

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-01 16:39:42 +01:00
Uladzimir Trehubenka
7b69dfebb5 plugin/file: fix panic in miekg/dns.CompareDomainName() (#3337)
Signed-off-by: utrehubenka <utrehubenka@infoblox.com>
2019-10-01 13:22:42 +01:00