Commit graph

91 commits

Author SHA1 Message Date
James Hartig
a469a17cdf Instead of hardcoding plugin lists in autopath/health, use interfaces. (#1306)
Switched health and autopath plugin to allow any plugins to be used instead
of a hardcoded list. I did not switch federation over since it wasn't
obvious that anything other than kubernetes could be used with it.

Fixes #1291
2017-12-12 20:40:30 +00:00
Miek Gieben
5a7e440476
plugin/file: fix crash (#1301)
When z.Tree.Prev returns zero we should break out of this loop, not
use elem as if nothing has happened.

Can be triggered by sending edns0 to unsigned zone.
2017-12-11 14:32:51 +00:00
Miek Gieben
27da0eba04
plugin/file: Fix response for qtype=DS (#1300)
DS is peculiar and needs some special cases to do the right things.
For a direct query return the DS, but if we're hitting below the
delegation return the NS+DS in a delegation response.
2017-12-11 14:17:41 +00:00
Miek Gieben
6cd0050c09
file/plugin: if there is a delegation use that (#1299)
Don't put NS records in the answer section; if we see it is delegated
we should put the records in the AUTHORITY section.

This removes a special case, which is good.
2017-12-11 13:22:19 +00:00
Miek Gieben
cf5418a015
plugin/nsid: Small doc cleanup (#1293)
add an example and some typos fixed.
2017-12-09 09:37:02 +00:00
Brad Beam
850a024905 Changing switch to compare on constants versus strings (#1285) 2017-12-07 22:31:13 -06:00
Brad Beam
986512892d Consolidating const declarations (#1287) 2017-12-07 23:04:02 +00:00
Miek Gieben
0e8ceea1d6
plugin/proxy: skip hc for https_google (#1272)
If protocol is https_google we do the health checks wrong, i.e. we're healthchecking the wrong
endpoint, hence the health check code below should not be executed. See issue #1202.
This is an ugly hack and the thing requires a rethink. Possibly in conjunction with moving
to the *forward* plugin.
2017-12-07 22:25:05 +00:00
Ruslan Drozhdzh
45ef657d36 Increase performance of Dnstap plugin (#1280)
- added dnstapEncoder object which incapsulates marshalling of dnstap
   messages to protobuf and writing data to connection

 - dnstapEncoder writes data directly to connection object. It doesn't
   use the framestream's "write" method, because it writes data to
   intermediate buffer (bufio.Writer) which leads to unnecessary
   data copying and drops the performance

 - dnstapEncoder reuses a preallocated buffer for marshalling dnstap
   messages. Many messages are added to the same buffer. They are
   separated with a "frame length" 4-byte values, so the buffer content
   is writen to connection object in the format compatible with
   framestream library

 - added test which guarantees that dnstapEncoder output is the same
   as framestream Encoder output

 - the performance increase is about 50% in (dio *dnstapIO) serve() method
   of dnstap plugin. The overall coredns performance increase is about 10%
   in the following configuration:

   .:1053 {
       erratic {
           drop 0
           truncate 0
           delay 0
       }
       dnstap tcp://127.0.0.1:6000 full
       errors stdout
   }

   tested with dnsperf tool
2017-12-06 10:36:04 +00:00
Rene Treffer
98632cd4a6 Fix time bucketing of response time (#1274) 2017-12-05 18:51:55 +00:00
Yong Tang
0baab055df Update etcd/README.md for multiple endpoints, and add additional test cases (#1277)
This fix tries to address the issue raised in 1275 to clarify
the syntax for multiple endpoints specification.

This fix also adds additional test cases to demo the usage.

This fix fixes 1275.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-12-05 18:02:37 +00:00
Yong Tang
5bafa6d97f Update docs with missing ~ (#1276)
Looks like the last commit missed a `~` in the docs.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-12-04 16:49:04 +00:00
Yong Tang
b52c3418b2
Add NSID plugin support for CoreDNS (#1273)
* Add NSID plugin support for CoreDNS

This fix adds NSID plugin support for CoreDNS, as was proposed
in 1256.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Add test cases for NSID plugin

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Generate code for NSID plugin

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Use hostname as the default (as with bind), and remove unneeded copy

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Add README.md

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-12-04 08:28:27 -08:00
Miek Gieben
7cc3b08f65
plugin/proxy: when HC fails increase fails (#1270)
When we failing the healthcheck we should increate the fails for this
host; which is the *bleeping* point of doing the HC in the first place.

Add the missing atomic.Adds.

Fixes #1247
2017-12-01 15:57:34 +00:00
Miek Gieben
0d103ff57c
plugin/proxy: add note about HC and google_https (#1269)
HC for google_https does not work because it does not HC the correct
set of IPs. Hard to solve in the current code - rather use forward as
the new impl. and leave this as legacy.

Remove superfluous println that we are refreshing the dns.google.com IP
address.
2017-12-01 13:21:18 +00:00
Uladzimir Trehubenka
861e2382c2 Added reconnect feature for dnstap plugin (#1267) 2017-12-01 11:16:14 +00:00
Miek Gieben
917965fa86
metrics: use exponentional buckets (#1261)
* metrics: use exponentional buckets

See  https://github.com/kubernetes/dns/pull/168
2017-12-01 11:15:05 +00:00
Miek Gieben
f96555476e
plugin/dnssec: Drop inserting DS records on delegation (#1266)
See #1211 for disuccsion; current code is probably the wrong thing to
do; rethink if we need/want this. Comment out the code for now.
2017-12-01 11:14:39 +00:00
Miek Gieben
e9699c42b7
plugin/rewrite: don't set or use ecs.DraftOption (#1262)
* plugin/rewrite: don't set or use ecs.DraftOption

Don't know why we are accessing this and explicitally setting it to
False (the default).
Any kill with fire - makes the build, build again.

* remove this
2017-11-28 14:03:20 +00:00
Uladzimir Trehubenka
6d6e1357b9 Dnstap plugin refactoring (#1257) 2017-11-27 21:36:14 +00:00
Ben Kochie
06006fac56 Update timing histograms (#1253)
* Use seconds for bucketing.
* Add template for high accuracy timing buckets to avoid copy-pasta.
2017-11-27 21:34:26 +00:00
Miek Gieben
9d52b5acb9
plugin/etcd: drop inflight (#1249)
Use caching, just ask etcd for every query. This also improves
throughput because the single lock in inflght is bypassed.
2017-11-26 17:21:24 +00:00
Chris O'Haver
614ed4c80d fix external service type check (#1246) 2017-11-22 11:17:27 +00:00
Chris O'Haver
6e4520ce96 plugin/k8s: ipv6 UT for endpoint (#1243)
* ipv6 UT for endpoint

* tweak
2017-11-16 16:24:49 -05:00
Miek Gieben
70a5a098c1
plugin/kubernetes: Fix reverse TTL response (#1240)
Remove most 303 TTLs (those get skipped by the test) and use 5, which is
the default for all tests.
2017-11-15 15:04:17 +00:00
Miek Gieben
621dd36f6d
plugin/kubernetes: set TTL on pod responses (#1239)
The TTL was still zero, instead it should adhere to the k.ttl setting.
Change this and update tests to match.
2017-11-15 14:06:37 +00:00
Chris O'Haver
99dd8f99f3 plugin/k8s: clean up and add some ipv6 tests (#1237)
* clean up and add some ipv6 tests

* aaaa endpoint

* gofmt
2017-11-15 07:16:04 +00:00
Miek Gieben
c37bf56b1e
plugin/kubernetes: correctly set NODATA for ns (#1229)
* plugin/kubernetes: Add GetNamespaceByName

A bare or wildcard query for just the namespace should return NODATA,
not NXDOMAIN, otherwise we deny the entirety of the names under the
namespace.

Add test to check for this in pod verified mode.

* Review

More comments and move namespace code to namespace.go
2017-11-13 21:51:51 +00:00
Miek Gieben
7c7a233b83 this too 2017-11-13 16:15:10 +00:00
Miek Gieben
d0c7a87b69 Merge branch 'master' of github.com:coredns/coredns 2017-11-13 16:08:43 +00:00
Miek Gieben
42504332ae plugin/rewrite: lowercase error
super small cleanup; smaller case return errors.
2017-11-13 16:08:06 +00:00
Andy Goldstein
f4f1736329 plugin/kubernetes: check err in getClientConfig (#1230)
Check the error returned by clientConfig.ClientConfig() before trying to
set cc.ContentType.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-13 16:01:57 +00:00
Miek Gieben
52b49f4838
plugin/health: implement dyn health checks (#1214)
Implement health.Healther in erratic and kubernetes plugin. The
kubernetes' healtcheck is only performed on startup - i.e. turn
healthy after the initial loading.

Erratic follow the drop count: every query%drop turns the healthcheck
unhealthy.

Fixes: #985
2017-11-13 09:52:40 +00:00
Christian Nilsson
46a187df8f plugin/log: remove need to specify stdout (#1221)
* plugin/log: remove need to specify stdout

Since log will only be output to stdout is doesn't make sense to
specify it in Corefile.

Fixes: #1218

* fixup! plugin/log: remove need to specify stdout
2017-11-13 09:23:27 +00:00
Chris O'Haver
9b8ee1c119
plugin/k8s: fix endpoint index creation (#1222) 2017-11-10 15:38:45 -05:00
Chris O'Haver
a78f46fb28 plugin/k8s: Use service IP index in reverse lookups (#1212)
* use index for svc reverse lookup

* temp revert

* restore reverse.go

* restore reverse_test.go
2017-11-10 16:59:21 +00:00
Miek Gieben
beef212fbe
plugin/log: remove OutputFile (#1217)
* plugin/log: remove OutputFile

We use stdout for everything, remove OutputFile as it isn't used and
causes confusion.

Fixes #1216

* PR feedback
2017-11-10 15:17:12 +00:00
Miek Gieben
0186aadfcf
fuzz: put fuzzing stuff in own build tag (#1215)
No need to have this build all the time.
2017-11-10 13:59:42 +00:00
Chris O'Haver
1a96fd2aee plugin/k8s: fix pods disabled behavior (#1207)
* fix pods disabled behavior

* do away with pod mode specific error
2017-11-08 18:58:48 +00:00
Chris O'Haver
0b93ea5147 k8s readme tweaks (#1206)
fix minor capitalization and grammar errors
2017-11-08 12:08:32 -05:00
Brian Akins
3527be6c00 Add option to use pod name rather than IP address for Kubernetes (#1190)
Change to use a new 'endpoints' directive and use a constant

Add initial docs for 'endpoints' directive

Add tests to Kubernetes setup for endpoints

Changes based on PR feedback

endpoint_pod_names is a boolean config option. Chahanged docs to reflect this.

Add a test when endpoints_pod_names is not set

Update README.md

Remove endpointNameModeName as it is no longer used
2017-11-08 08:07:10 -05:00
Miek Gieben
2c80551fdc
plugin/{kubernetes/etcd}: dynamic SOA (#1188)
Add a dynamic SOA record (at least the serial and minttl). This create
another interface that should be implemented by the backends.

For now default to returning epoch in as a uint32 (no change from
before).

Lower the minTTL returned to 30s (from 60s)
2017-11-01 10:11:34 +00:00
Miek Gieben
fa2ae3fb43 docs: updates some, remove others (#1187)
Fix typo in kubernetes/README.md and remove DEV-README.md as it is stale
and information on the website is more up to date.

Remove large sections of text in plugin.md; just talk about how to
structure your plugin and docs.
2017-10-31 09:33:41 -04:00
Pat Moroney
1d4ac4adbb add goroutine to check hosts file for updates (#1180)
* add goroutine to check hosts file for updates

* rename parseFile to parseReader, remove extra error check
2017-10-31 07:40:47 +00:00
Miek Gieben
87c9f00c83
readme: more tests (#1184)
* readme: more tests

Add dnssec and file plugin to the test readme. This requires creating a
bunch of files with the right content. Doing so already unconvered an
unconditional type assertion in DNSSEC. This PR will include the fix for
that as well.

Also extended the snippets in the file plugin README, so that they are
whole Corefile - showing more value and checking all corefile snippets.

Create outliner right now is the kubernetes plugin, because even setting
the right env vars will result in:

open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory":

Which we can't create for a test.

* lint
2017-10-31 07:14:49 +00:00
Miek Gieben
c2d93f7182 plugin/dnstap: some cleanup (#1172)
Some cleanup in proxy and dnstap:
* just use time pkg directly and side step the indirection for Epoch
* Use Set in SetQueryEpoch to be more Go like. (Looked like a reader)
* Don't maintain two sets of time, we already track start, so use that.
* Use time.Time and convert when needed
* dedent the toDnstap function and put in a separate file
2017-10-25 19:46:41 +01:00
Pat Moroney
25367a4329 remove the defer 2017-10-24 14:28:41 -06:00
Pat Moroney
53d9bff707 read lock around ReadHosts() 2017-10-24 13:46:58 -06:00
Pat Moroney
680e6bd5c3 move ReadHosts out of the lock 2017-10-24 10:34:16 -06:00
Pat Moroney
7ad99d0d36 Fix locking for hosts plugin 2017-10-24 10:27:07 -06:00