Commit graph

2870 commits

Author SHA1 Message Date
Rob Maas
b0d37c5443 fix tls_servername in cloudflare example (#2466) 2019-01-15 09:18:20 -08:00
Chris Aniszczyk
ea5ee43d58 Reference security audit in README (#2468)
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2019-01-15 09:16:18 -08:00
Yong Tang
7bd6855155
Deprecate multiple endpoints for out-of-cluster k8s api (#2454)
This fix deprecates endpoints for out-of-cluster k8s api,
The Corefile still takes multiple endpoints though only
the first one is used. A warning is shown if there are
multiple endpoints.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-13 10:09:51 -08:00
Miek Gieben
f655d404d4
Fix setup_test in plugin/kubernetes (#2460)
PR race condition, fix the test data for the setup.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-13 17:16:36 +00:00
Miek Gieben
9c16ed1d14
Default to upstream to self (#2436)
* Default to upstream to self

This is a backwards incompatible change.

This is a massive (cleanup) PR where we default to resolving external
names by the coredns process itself, instead of directly forwarding them
to some upstream.

This ignores any arguments `upstream` may have had and makes it depend
on proxy/forward configuration in the Corefile. This allows resolved
upstream names to be cached and we have better healthchecking of the
upstreams. It also means there is only one way to resolve names, by
either using the proxy or forward plugin.

The proxy/forward lookup.go functions have been removed. This also
lessen the dependency on proxy, meaning deprecating proxy will become
easier. Some tests have been removed as well, or moved to the top-level
test directory as they now require a full coredns process instead of
just the plugin.

For the etcd plugin, the entire StubZone resolving is *dropped*! This
was a hacky (but working) solution to say the least. If someone cares
deeply it can be brought back (maybe)?

The pkg/upstream is now very small and almost does nothing. Also the
New() function was changed to return a pointer to upstream.Upstream. It
also returns only one parameter, so any stragglers using it will
encounter a compile error.

All documentation has been adapted. This affected the following plugins:
* etcd
* file
* auto
* secondary
* federation
* template
* route53

A followup PR will make any upstream directives with arguments an error,
right now they are ignored.

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

* Fix etcd build - probably still fails unit test

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

* Slightly smarter lookup check in upstream

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

* Compilez

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-13 16:54:49 +00:00
Miek Gieben
6b56a9c921
Tag version 1.3.1 (#2458)
Tag the 1.3.1 version.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-13 14:18:46 +00:00
Yong Tang
5274c4454d
Remove version pinning of thrift, ugoriji/go, and etcd (#2457)
* Remove version pinning of thrift, ugoriji/go, and etcd

For incompatibility reasons at one point, we were forced
to pining the version of thrift, ugoriji/go, and etcd
to very specific versions (some are not versioned commits)
to get around the build issues.

It looks like those incompatibility issues are gone so
we could remove the pinning of thrift, ugoriji/go, and etcd.

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

* Update Gopkg.lock

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

* Update vendor library

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-12 12:02:19 -08:00
Miek Gieben
003355e18e new dns version (#2456)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-12 04:17:13 -08:00
Chris O'Haver
22cacc7cb1 fix soa min ttl in tests cases (#2451) 2019-01-10 15:49:53 +00:00
Chris O'Haver
875c11a0cb set minttl to ttl setting (#2446) 2019-01-10 07:34:22 +00:00
Miek Gieben
0efa99e954
docs: update the compile-from-source section (#2449)
You can't go get coredns - update this section.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-09 09:28:08 +00:00
Chris O'Haver
18f25dbef3
plugin/kubernetes: fix case preservation and add test (#2430)
* fix case preservation and add test
* only fix case in k8s
2019-01-08 08:30:03 -05:00
ckcd
418edd2a2f plugin/log: support multi nameScope (#2420) 2019-01-08 07:40:50 +00:00
Yong Tang
53d1afbaf2
Error out when multiple https endpoints are specified. (#2438)
This fix will error out when multiple https endpoints are specified,
as additional work is needed to support beyond http.

This fix fixes 1464.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-07 09:28:03 -08:00
Miek Gieben
06efc07f46
Generate man-pages (#2439)
Almost 100% mechanical change, except the fact that import/import.md
is moved to import/README.md

No content changes.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-06 09:15:34 +00:00
Miek Gieben
fb32f7a358 Add import plugin to give it docs (#2428)
* wip: add import to make it have docs

Fake the import plugin further to give it proper docs. This should help
make it more discoverable.

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

* Finish writing the documentation

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-05 19:41:47 -08:00
Miek Gieben
652b9a69d8
plugin/kubernetes: add memory usage guidelines (#2424)
Add words in object.go on the memory use and put some future ideas in
there to use even less (if we have to at some point).

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-05 16:58:27 +00:00
Miek Gieben
35b74eb197
plugin/log: update nodata/NXDOMAIN story a bit (#2416)
* plugin/log: update nodata/NXDOMAIN story a bit

Add more words on nodata and NXDOMAIN which is a confusing DNS
"feature"

Fixes: #2412

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

* typos

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-05 16:33:27 +00:00
jmpcyc
c56603ea79 update zplugin.go path && add .PHONY for all target (#2433)
* update zplugin.go path && add .PHONY for all target

* update zplugin.go path && add .PHONY for all target

* update zplugin.go target
2019-01-04 20:09:26 +00:00
Miek Gieben
4f9fade38e new miekg/dns (#2435)
New release, kick of tests.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-04 12:00:50 -08:00
Miek Gieben
300506ee91
plugin/log: detail {combined} and {common} (#2422)
These can be used (and are handy), document them.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-04 19:39:02 +00:00
Miek Gieben
5e4faf9bb5 docs: more on imports and snippets (#2423)
Add some docs in the manual page. Problem here is that it is only in the
manual page and we don't publish this particular one on coredns.io.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-04 03:47:28 +08:00
Isolus
7642995558 disable ra flag for several plugins (#2408)
* disable ra flag for several plugins

* removed unnecessary assignment

* removed more unnecessary assignments
2018-12-30 17:05:08 +01:00
Taras Tsugrii
38790c7222 Fix nits in address.go. (#2404) 2018-12-17 10:24:59 +00:00
Miek Gieben
14f8b5d75a
Fuzzing: add more fuzzing targets (#2402)
* Add more fuzzing

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

* More fuzzing targets

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

* Fuzzing: add more fuzzing targets

Also add Corefile fuzzing.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-17 07:49:15 +00:00
Miek Gieben
235aac32ad plugin/k8s_external: added manpage (#2401)
Missed this before the release. Add the manpage.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-16 13:48:37 -08:00
Miek Gieben
775cf92f03 plugin/loop: show from -> to (#2400)
Show from and to address when detecting a loop they may aid in
debugging.

Hard to create a unit test, but this is a startup run with self induced
loop:

~~~ corefile
.:1053 {
    loop
    log
    forward . 127.0.0.1:1053
}
~~~~

~~~
:1053
2018-12-16T10:11:03.695Z [INFO] CoreDNS-1.3.0
2018-12-16T10:11:03.695Z [INFO] linux/amd64, go1.11,
CoreDNS-1.3.0
linux/amd64, go1.11,
2018-12-16T10:11:03.696Z [FATAL] plugin/loop: Loop (127.0.0.1:51384 -> :1053) detected for zone ".", see https://coredns.io/plugins/loop#troubleshooting. Query: "HINFO 2781022615773629442.4133547885299871809."
~~~

Update the docs and polished that a bit as well.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-16 13:48:09 -08:00
Yong Tang
6b8c154441 Update client-go to v10.0.0 (Kubernetes 1.13) (#2382)
* Update client-go to v10.0.0 (Kubernetes 1.13)

This fix updates client-go to v10.0.0 which matches
Kubernetes 1.13 (released several days ago).

Other changes in Gopkg.yaml:
- Updated apimachinary, api, klog, yaml associated with k8s version
  go dep will not automatically match the version.
- Added [prune] field (otherwise go dep will not prune automatically)

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

* Updated Gopkg.lock

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

* Updated vendor for client-go v10.0.0

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-12-16 09:04:41 +00:00
Miek Gieben
c8f0e94026
Release 1.3.0 (#2399)
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-15 15:49:37 +00:00
Miek Gieben
c1c98924c3
Add new plugin: external - resolve k8s ingress and LB address with external names (#2379)
* Add new plugin: external

This plugin works in conjunction with the kubernetes plugin and exports
ingress and LB addresses as DNS records. It bypasses backend.go and
backend_lookup.go flow because it is not needed.

README, tests are implemented. The tests only exercise the unit tests,
this has not been tested in any ci.

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

* Rename to k8s_external

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

* go gen

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-14 09:41:51 +00:00
Miek Gieben
d9880681c3
mechanical: make -f Makefile.doc (#2390)
update the manpages by running make -f Makefile.doc

No other changes.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-11 20:46:02 +00:00
Miek Gieben
d0adf6f3a6
edns0 compliance: set correct RCODE (#2388)
The miekg/dns API is a bit scruffy (documentation PR in flight soon),
but these both need to be set for the correct RCODE to be reflected in
the returned packet.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-11 20:27:29 +00:00
Miek Gieben
fed307bfce
core: edns0 tweaks (#2385)
* core: edns0 tweaks

Per comment thread in https://github.com/coredns/coredns/pull/2357 which
spotted a bug; updated the code and added some comments.

This function should probably be redone as some point or made obsolete.

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

* Remove setting options when m is EDNS0 record

Assume upstream set them correctly or a plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-10 19:43:46 +00:00
Miek Gieben
9abbf4a4a0 map bool -> map struct{} (#2386)
This clear out the remaining map[x]bool usage and moves the bool to an
empty struct.

Two note worthy other changes:

* EnableChaos in the server is now also exported to make it show up in
  the documentation.
* The auto plugin is left as is, because there the boolean is
  explicitaly set to false to signal 'to-be-deleted' and the key is left
  as-is.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-10 02:17:15 -08:00
Yong Tang
c788649a00 Replace bool map with struct{} map in chaos plugin (#2384)
Automatically submitted.
2018-12-08 23:57:57 +00:00
Miek Gieben
95546dfdfe plugin/kubernetes: smaller map (#2383)
* plugin/kubernetes: smaller map

to continue with a theme: the map[string]bool can be reduced
to map[string]struct{} to reduce a tiny amount of memory.

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

* fix tests

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-08 15:40:07 -08:00
Yong Tang
0f7d95b1e7
Convert bool map to struct{} map in etcd.go (#2381)
This fix converts bool map to struct{} map in etcd.go
(there might be several other places).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-12-08 06:15:11 -08:00
Miek Gieben
f02da83e9c plugin/kubernetes: make prefix key in msg.Service a const (#2378)
This is a relic from the etcd integration and only used to remove in the
final answer returned to the client. We do need it. Make it a constant
and only one character wide.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-08 05:37:00 -08:00
Miek Gieben
65be561722 Make backand.go maps smaller (#2380)
These maps where all map[x]bool. Change this a map[x]struct{} as this
is smaller and we only use these map to signal "this element exists".

This should preserve a (small) amount of memory.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-08 05:19:22 -08:00
Miek Gieben
8a5eb58bc0 msg.Service: optimize a bit (#2374)
Make the NewSRV and friends slightly smarter. Optimize the calling of
targetStrip which is almost certainly not used.

Added benchmark show a modest improvement:

benchmark             old ns/op     new ns/op     delta
BenchmarkNewSRV-4     300           283           -5.67%

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-07 12:09:09 -08:00
StormXX
16197a1add fix a document error (#2376) 2018-12-07 09:45:13 +00:00
Daniel Garcia
4a3f5cc41e Use Trim(Prefix/Suffix) instead of Trim(Left/Right) in rewrite prefix plugin (#2364) (#2372) 2018-12-06 22:10:46 +00:00
Miek Gieben
fc667b98e0
Fix EDNS0 compliance (#2357)
* Fix EDNS0 compliance

Do SizeAndDo in the server (ScrubWriter) and remove all uses of this
from the plugins. Also *always* do it. This is to get into compliance
for https://dnsflagday.net/.

The pkg/edns0 now exports the EDNS0 options we understand; this is
exported to allow plugins add things there. The *rewrite* plugin used
this to add custom EDNS0 option codes that the server needs to
understand.

This also needs a new release of miekg/dns because it triggered a
race-condition that was basicly there forever.

See:
* https://github.com/miekg/dns/issues/857
* https://github.com/miekg/dns/pull/859

Running a test instance and pointing the https://ednscomp.isc.org/ednscomp
to it shows the tests are now fixed:

~~~
EDNS Compliance Tester
Checking: 'miek.nl' as at 2018-12-01T17:53:15Z

miek.nl. @147.75.204.203 (drone.coredns.io.): dns=ok edns=ok edns1=ok edns@512=ok ednsopt=ok edns1opt=ok do=ok ednsflags=ok docookie=ok edns512tcp=ok optlist=ok
miek.nl. @2604:1380:2002:a000::1 (drone.coredns.io.): dns=ok edns=ok edns1=ok edns@512=ok ednsopt=ok edns1opt=ok do=ok ednsflags=ok docookie=ok edns512tcp=ok optlist=ok

All Ok
Codes
ok - test passed.
~~~

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

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

* typos in comments

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-06 21:18:11 +00:00
Daniel Garcia
f51c110511 Use TrimPrefix instead of TrimLeft in rewrite prefix plugin (#2364) (#2370) 2018-12-06 21:02:07 +00:00
Chris O'Haver
9a393ac5c8 clean pre-submit checks (#2367)
Automatically submitted.
2018-12-05 21:20:20 +00:00
Miek Gieben
59a49c5ff7 Scrub: Do more to avoid fragmentation (#2333)
Automatically submitted.
2018-12-04 20:15:57 +00:00
Chris O'Haver
b53cc51f53 plugin/loop: Improve loop troubleshoot docs (#2363)
* improve loop troubleshoot docs

* fix spelling
2018-12-04 11:58:20 +00:00
Yong Tang
e5f5da4297 Update Prometheus to 0.9.1 (#2360)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-12-01 22:38:03 +00:00
Miek Gieben
4c86e546ac
plugin/forward: remove truncate logic (#2320)
I think this is causing problem and it will actually clash with the
scrubbing that now happens for all plugins anyway. We're assuming the
returned message will be valid even with tc being set. request.Scrub
follows that same logic.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-01 09:07:42 +00:00
Miek Gieben
bae9514e94
pkg/up: implement backoff (#2342)
* pkg/up: implement backoff

Every 2nd failure we double the interval until we hit 4 * interval. This
to have some sort of backoff, esp when a large cluster of coredns shares
an upstream (original intent of up package) they will hammer the
upstream. This put some back pressure on that.

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

* Update plugin/pkg/up/up.go

Co-Authored-By: miekg <miek@miek.nl>
2018-12-01 09:07:03 +00:00