Commit graph

956 commits

Author SHA1 Message Date
Miek Gieben
ec9e8168e5
plugin/file: add small zonefile example (#4509)
Watching TGI Kubernetes 147 and it helps to show a small zonefile
example in the documentation.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-08 12:15:20 +01:00
Miek Gieben
c2028e330f
plugin/kubernetes: don't return when ServerVersion return an error (#4490)
When err=nil try to determine the version of the k8s cluster and disable
endpoint slices. Don't return from connecting to the cluster.

In the future we should just default to true, and delete all this code.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-02-25 18:14:57 +01:00
coredns-auto-go-fmt[bot]
ff9b4bcb98 auto go fmt 2021-02-24 10:22:15 +00:00
coredns-auto-trailing-whitespaces[bot]
f9b98a1d06 auto remove trailing whitespaces 2021-02-23 09:12:58 +00:00
slick-nic
0103931263
Rewrite SRV targets and additional names in response (#4287)
* Rewrite plugin - rewrite SRV targets and names in response answer and additional records

Signed-off-by: Nic Colledge <nic@njcolledge.net>

* Added README content to describe new behaviour

Signed-off-by: Nic Colledge <nic@njcolledge.net>

* Added more record types to rewrite handling based on PR/Issue feedback

Signed-off-by: Nic Colledge <nic@njcolledge.net>

* Updated README.md for plugin

Signed-off-by: Nic Colledge <nic@njcolledge.net>

* Updated unit tests.
Small refactor of getTarget... function.

Signed-off-by: Nic Colledge <nic@njcolledge.net>

* Refactor to add response value rewrite as answer value option

Signed-off-by: Nic Colledge <nic@njcolledge.net>

* Removed TODO comment, added test for NAPTR record.

Signed-off-by: Nic Colledge <nic@njcolledge.net>
2021-02-23 10:12:40 +01:00
Miek Gieben
c4720b8ad2
plugin/sign: track zone file's mtime (#4431)
* plugin/sign: track zone file's mtime

Resign if the original zone's mtime is change in some way.

Closes #4407

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

* Update plugin/sign/README.md

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>

Co-authored-by: Yong Tang <yong.tang.github@outlook.com>
Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
2021-02-10 07:56:03 -08:00
Jun Chen
a5bc3891e8
make kubernetes plugin kubeconfig argument 'context' optional (#4451)
Signed-off-by: answer1991 <answer1991.chen@gmail.com>
2021-02-09 14:36:32 +01:00
Miek Gieben
56bc7f399a
plugin/transfer: only allow outgoing axfr over tcp (#4452)
* plugin/transfer: only allow outgoing axfr over tcp

Return refused when the query comes in over udp.
No need to add a new test case as the current crop needed to be changed
to use TCP.

Fixes: #4450

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

* transfer tests: this needs tcp as well

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-02-05 10:51:29 +01:00
Miek Gieben
03812bb1e7
plugin/rewrite: copy msg before rewritting (#4443)
Copy the msg to prevent messing with the (via the pointer) original
created message that may be stored in the cache or anything other data
store.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-02-01 06:52:50 -08:00
George Shammas
117a389e40
plugin/acl: add the ability to filter records (#4389)
Currently ACLs only allow for allow and block, however it isn't
always desirable to set the status code to REFUSED. Often times
you want to completely hide the fact that those records even exist.

Adding the ability to acl to filter results makes it significantly
harder for a third party to know that the records are being masked.

Signed-off-by: George Shammas <george@shamm.as>
2021-02-01 06:52:23 -08:00
Miek Gieben
60e1490ed6
copy rrs (#4416)
* Revert "make copies of RRs before returning them (#4409)"

This reverts commit 8b2ff6c388.

* Document copying responses

See #4409 and the comments. This documents that issue, but doesn't
change the in-tree plugins just yet.

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

* Update plugin.md

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
2021-01-28 16:50:35 +01:00
Bob
d8d2c16905
plugin/trace - Use compatible tag name for datadog (#4408)
Traces are currently working properly with datadog with the exception of having the ability to facet the tags

![image](https://user-images.githubusercontent.com/5513509/105051238-dddbbd00-5a6e-11eb-8fb2-071b3b1fa8cc.png)

In order to get valuable graph in dashboard the tag on the metrics need to be faceted by datadog.
This PR update the tags with facetable path.
While keeping backward compatibility with existing path for zipkin.

Graph like:
![image](https://user-images.githubusercontent.com/5513509/93375960-339e1f80-f859-11ea-81f0-a1074c375630.png)
![image](https://user-images.githubusercontent.com/5513509/93375997-4153a500-f859-11ea-9f8d-63d45217c681.png)
![image](https://user-images.githubusercontent.com/5513509/93376064-5597a200-f859-11ea-823a-6768f59e3497.png)
![image](https://user-images.githubusercontent.com/5513509/93376405-d6ef3480-f859-11ea-8d6f-58dda247cc86.png)
![image](https://user-images.githubusercontent.com/5513509/93376518-069e3c80-f85a-11ea-9a7e-0426a3817439.png)

Signed-off-by: bob <bob.bouteillier@datadoghq.com>
2021-01-28 16:38:24 +01:00
Maxime Ginters
b1173ed2a5
plugin/forward Add rcode and rtype to request_duration_seconds metric (#4391)
* plugin/forward Add rcode and rtype to request_duration_seconds metric

Signed-off-by: Maxime Ginters <maxime.ginters@shopify.com>

* Control the cardinality of query type

Signed-off-by: Maxime Ginters <maxime.ginters@shopify.com>
2021-01-28 16:37:17 +01:00
Lars Ekman
6ff19342d3
Corrected detection of K8s minor version (#4430)
Fixes #4428

Signed-off-by: Lars Ekman <lars.g.ekman@est.tech>
2021-01-26 09:27:37 -05:00
Miek Gieben
38d4dacb88
Fix import ordering presubmit test (#4422)
Automatically submitted.
2021-01-24 17:28:49 +00:00
Frank Riley
eba74389c4
Fix #4395, fix out of order messages and fix forward perspective. (#4396)
Signed-off-by: Frank Riley <fhriley@gmail.com>
2021-01-21 10:00:27 +01:00
Chris O'Haver
8b2ff6c388
make copies of RRs before returning them (#4409)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-01-21 09:59:58 +01:00
ZouYu
66fcaaeafc
Fix some typos (#4412)
Signed-off-by: zouyu <zouy.fnst@cn.fujitsu.com>
2021-01-20 08:59:03 +01:00
Miek Gieben
342eae9b4b
plugin/file: guard against cname loops (#4387)
Automatically submitted.
2021-01-15 18:26:04 +00:00
Chris O'Haver
5c07ab7b78
doc bind collision issue (#4394)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-01-15 17:26:34 +01:00
sschepens
b2a22eff04
Prevent race from prefetching (#4368)
Automatically submitted.
2021-01-15 12:32:49 +00:00
Miek Gieben
d31b118978
plugin/transfer: fix go-routine leak (#4380)
PR #4161 is stalled. Tried to cherry pick the code from there, but that
led to conflicts, manually copying over while taking into account the
comments on that PR. Use that code and extend the error checking, don't
modify existing tests and make the badwriter test simpler.

Closes: #4161

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

add tests

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-01-13 09:16:01 +01:00
Miek Gieben
fd705b4783
forward/up: HC every 0.5 seconds, do not do exponential backoff (#4371)
* remove hc backoff

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* fix mutex

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* Update plugin/pkg/up/up.go

* fmt

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

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
2021-01-12 13:55:01 +01:00
luanphantiki
ed891c5c4e
fix record missing for zone with many of records (#4328)
* fix record missing for zone with many of records

* Update debug log

* Update debug mesg

* update test_clouddns
2021-01-12 13:38:18 +01:00
Gunadhya
d54b5c93fe
d-Updated Azure plugin NS record (#4383)
Signed-off-by: gunadhya <6939749+gunadhya@users.noreply.github.com>
2021-01-11 14:58:56 -08:00
Miek Gieben
ae330a3f55
plugin/file: document wrong behavior in lookup fox Apex (#4376)
An apex only zone returns the wrong answer, document this by adding a
test.

Closes: #4374

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-01-11 09:21:54 +01:00
Miek Gieben
02a205ae91
plugin/secondary: small fixes in the readme (#4375)
Fix a typo and make clear that multiple addresses are allowed.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-01-10 18:06:28 +08:00
Miek Gieben
296222d613
plugin/dnssec: Change hash key input (#4372)
Make this vastly simpler and more efficient. Adding all the bytes and
then letting loose fnv doesn't add anything and may actually do the
wrong thing.

See: #3953
Fixes: #3953

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-01-10 08:30:00 +01:00
Guangwen Feng
876650d638
Fix golint issue caused by typo (#4365)
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2021-01-06 08:34:32 -05:00
mgugger
67e90a0656
Azure Plugin: Iterate over all RecordSetListResultPage Pages (#4351)
* Azure Plugin: Iterate over all pages for records

Signed-off-by: Manuel Gugger <manuel.gugger@gmail.com>

* Azure Plugin: use := for assignment

Signed-off-by: Manuel Gugger <manuel.gugger@gmail.com>

* Remove unnecessary return param

Signed-off-by: Manuel Gugger <manuel.gugger@gmail.com>
2020-12-23 11:12:47 +01:00
Chris O'Haver
51c05679e6
plugin/kubernetes: Add support for dual stack ClusterIP Services (#4339)
* support dual stack clusterIPs

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* stickler

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* fix ClusterIPs make

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-12-21 02:30:24 -08:00
Jiang Biao
fc955fd166
[feat]:update the kubernets.go fix npe (#4338)
Signed-off-by: Biao Jiang <standup-jb@github.com>

Co-authored-by: biao.jiang@ximalaya.com <biao.jiang@ximalaya.com>
2020-12-16 12:31:34 +01:00
Chris O'Haver
9cb53487ec
respond with REFUSED when max_concurrent is exceeded to avoid caching it (#4326)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-12-15 14:02:15 +01:00
Chotiwat Chawannakul
aac422ff0f
Update README.md (#4331)
Automatically submitted.
2020-12-11 21:07:25 +00:00
Miek Gieben
108d26ebea
Move .LocalAddr() out of goroutine (#4281)
I don't have theory why this panics, but concurrency has something to do
with it, so get the address before we call the goroutine.

See #4271

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-12-11 08:49:47 -08:00
Chris O'Haver
6bbb48d403
plugin/file: Use NXDOMAIN response if CNAME target is NXDOMAIN (#4303)
* pass through nxdomain results

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* return srvfail and nodata results

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add test

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* cover more response cases

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-12-09 09:44:31 +01:00
Chris O'Haver
9121e78496
plugin/kubernetes: Fix dns programming duration metric (#4255)
* get data reqd to record latency before calling toFuncs
* refactor out unnecessary toFunc wrappers
* remove latency metric unit tests per PR feedback

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-12-01 15:29:05 -05:00
Miek Gieben
99f79817ac
plugin/trace: cleanup README.md (#4280)
Various improvements to the documentation. Started because `⚠️`
isn't a markdown feature (replace with Note:).

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-19 12:19:50 +01:00
Blake Ryan
c9c71d3904
plugin/azure return FQDN as MNAME in SOA record (#4286)
Automatically submitted.
2020-11-12 14:48:03 +00:00
Miek Gieben
9178f9d1ee
Remove newlines between braces (#4279)
These are found with: `pcregrep -M "}\n\n}" **/*.go`
Sometimes a unneeded newline is inserted, remove those.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-11 18:45:01 +01:00
coredns-auto-go-fmt[bot]
4b87be2a0e auto go fmt 2020-11-11 12:30:39 +00:00
Bob
b7814204a4
plugin/trace: Fix zipkin json_v2 (#4180)
Automatically submitted.
2020-11-10 19:03:14 +00:00
Miek Gieben
049369583b
pkg/tls: remove InsecureSkipVerify=true flag (#4265)
CWE-295 code scanning alert flag this. Seems OK to just remove it.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-05 20:08:59 +01:00
Miek Gieben
7bbcf6920f
add local plugin (#4262)
* add local plugin

See: #4260

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

* stickler bot

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

* See Also

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-05 15:02:07 +01:00
Miek Gieben
123da4c844
plugin/dnstap: remove config struct (#4258)
* plugin/dnstap: remove config struct

this struct is an uneeded intermidiate to get a dnstap it can be
removed. Remove the dnstapio subpkg: it's also not needed. Make *many*
functions and structs private now that we can.

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

* correct logging

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-05 14:37:16 +01:00
Miek Gieben
8759d00edd
forward doc update (#4254)
* forward: add example with multiple DoT upstreams

Remove Bugs section as this is a nice work around.

h/t https://twitter.com/mholt6/status/1284250606673080321

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

* Actually remove bugs section

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-03 06:32:49 -08:00
Miek Gieben
a136b7128b
plugin/dnstap: remove custom encoder (#4242)
* plugin/dnstap: remove encoder*.go

Those files reimplemented parts of the dnstap spec, we can just use the
dnstap functions for that. This leaves all the queuing that is enabled
and drops messages if the dnstap reader can't keep up. In the new code
flush() would never return an error (at least I couldn't make it do so),
so the reconnect functionally is moved to kick off when we get write
errors.

Some smaller cosmetic changes as well, `d.socket` is now `proto`, which
makes the dial() function smaller.

Total testing time is now <1s (which was the impetus to look into this
plugin *again*).

See #4238
The buffered channel needs to be sized correctly, as we may need to do
some queing if the dnstap reader can't keep up.

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

* add missing file

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

* update doc on queing

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-03 06:31:34 -08:00
Chris O'Haver
272ccb195d
plugin/kubernetes: Watch EndpointSlices (#4209)
* initial commit

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* convert endpointslices to object.endpoints

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add opt hard coded for now

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* check that server supports endpointslice

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* fix import grouping

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* dont use endpoint slice in 1.17 or 1.18

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* bump kind/k8s in circle ci to latest

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* drop k8s to latest supported by kind

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* use endpointslice name as endoint Name; index by Service name

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* use index key comparison in nsAddrs()

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add Index to object.Endpoint fixtures; fix direct endpoint name compares

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add slice dup check and test

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* todo

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add ep-slice skew dup test for reverse

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* nsaddrs: de-dup ep-slice skew dups; add test

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* remove todo

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* address various feedback

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* consolidate endpoint/slice informer code

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* fix endpoint informer consolidation; use clearer func name

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* log info; use major/minor fields

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* fix nsAddr and unit test

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add latency tracking for endpointslices

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* endpointslice latency unit test & fix

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* code shuffling

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* rename endpointslices in tests

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* remove de-dup from nsAddrs and test

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* remove de-dup from findServices / test

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-10-30 08:14:30 -04:00
Miek Gieben
c840caf1ef
Speed up testing (#4239)
* Speed up testing

* make notification run in the background, this recudes the test_readme
time from 18s to 0.10s
* reduce time for zone reload

* TestServeDNSConcurrent remove entirely. This took a whopping 58s for
  ... ? A few minutes staring didn't reveal wth it is actually testing.
  Making values smaller revealed race conditions in the tests. Remove
  entirely.

* Move many interval values to variables so we can reset them to short
  values for the tests.

* test_large_axfr: make the zone smaller. The number used 64K has no
  rational, make it 64/10 to speed up.
* TestProxyThreeWay: use client with shorter timeout

A few random tidbits in other tests.

Total time saved: 177s (almost 3m) - which makes it worthwhile again to
run the test locally:

this branch:

~~~
ok  	github.com/coredns/coredns/test	10.437s
cd plugin; time go t ./...
5,51s user 7,51s system 11,15s elapsed 744%CPU (
~~~

master:

~~~
ok  	github.com/coredns/coredns/test	35.252s
cd plugin; time go t ./...
157,64s user 15,39s system 50,05s elapsed 345%CPU ()
~~~
tests/ -25s
plugins/ -40s

This brings the total on 20s, and another 10s can be saved by fixing
dnstapio. Moving this to 5s would be even better, but 10s is also nice.

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

* Also 0.01

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-10-30 10:27:04 +01:00
Miek Gieben
c2e4f2f1ab
docs: move Also See to See Also (#4245)
sed -i 's/Also See/See Also/' plugin/**/README.md

Some plugins did already use 'See Also', so it's all consistent now.

Fixes: #4196

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-10-28 10:56:35 -07:00