Commit graph

262 commits

Author SHA1 Message Date
Ondřej Benkovský
c2dbb7141a
add golangci-lint linter (#5499) 2022-07-10 11:06:33 -07:00
Chris O'Haver
e80d696502
plugin/k8s_external: Add support for PTR requests (#5435)
* Exclude External IP addresses from being added to the existing kubernetes' plugin IP->Service index
* Add support for PTR requests on External IPs of Services to the k8s_external plugin

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-07-06 13:55:15 -04:00
Ondřej Benkovský
e0dead4aa2
plugin/kubernetes : make kubernetes client log in CoreDNS format (#5461)
Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
2022-06-26 14:49:45 -07:00
Lorenz Brun
7a7b0a2b9b
Bump Kubernetes to 1.24 (#5364)
Signed-off-by: Lorenz Brun <lorenz@monogon.tech>
2022-05-04 13:38:21 -04:00
Chris O'Haver
c02cd52208
fix k8s start up timeout ticker (#5361)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-05-03 10:06:36 -04:00
Chris O'Haver
3fe9d41a21
plugin/k8s_external: fix external nsAddrs when CoreDNS Service has no External IPs (#4891)
fix external nsAddrs; add tests;

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-03-07 12:18:23 -05:00
Chris O'Haver
7263808fe1
plugin/k8s_external: implement zone transfers (#4977)
Implement transfer for k8s_external. Notifies not supported.

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-03-07 12:16:24 -05:00
Chris O'Haver
967814161a
use tickers instead of time.After to avoid memory leak (#5220)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-03-03 23:36:02 -08:00
Chris O'Haver
66dc74caeb
plugin/etcd+kubernetes: Persist truncated state to client if CNAME lookup response is truncated (#4715)
Persist the TC bit to client response for truncated CNAME lookups.
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-22 09:38:57 -05:00
Chris O'Haver
74d4e9bb1b
kubernetes: log server start delay and api connection failures (#5044)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-22 09:21:45 -05:00
Yong Tang
b1d5d7c572
Replace deprecated NewDeltaFIFO with NewDeltaFIFOWithOptions (#5200)
Replace deprecated  `cache.NewDeltaFIFO`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2022-02-22 09:20:29 -05:00
coredns[bot]
b40f2a0a44 auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2022-02-14 10:32:27 +00:00
Chris O'Haver
4693f40990
Revert "add wildcard warnings (#5030)" (#5167)
This reverts commit 744468ea78.
2022-02-09 11:25:15 -08:00
Chris O'Haver
4349b6fa63
dont panic on empty SRV segments (#5173)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-09 13:52:53 -05:00
Chris O'Haver
abaf938623
remove wildcard query functionality (#5019)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-09 09:25:10 -05:00
Chris O'Haver
ca476cec30
add wildcard query deprection notice to kubernetes readme (#5045)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-12-17 16:57:32 -05:00
Chris O'Haver
744468ea78
add wildcard warnings (#5030)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-12-09 08:24:48 -08:00
xuweiwei
b7b62b38ef
plugin/kubernetes: clean code (#5017)
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2021-12-01 09:26:18 -05:00
xuweiwei
5f900b86f5
cleanup some code (#4989)
Automatically submitted.
2021-11-19 16:15:58 +00:00
Chris O'Haver
5534625c75
plugin/kubernetes: Don't use pod names longer than 63 characters as dns labels (#4908)
Automatically submitted.
2021-10-06 15:59:37 +00:00
Chris O'Haver
e742b5ee34
plugin/kubernetes: fix reload panic (#4881)
* fix reload panic

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

* add comment

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

* o import ordering

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-09-22 16:28:51 +02:00
Chris O'Haver
88d94dc148
plugin/kubernetes: Only answer transfer requests for authoritative zones (#4802)
* check for zone match

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-08-13 11:02:00 -04:00
Manuel Rüger
4758070425
plugins/kubernetes: Switch to klog/v2 (#4778)
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2021-08-03 20:22:36 -07:00
coredns[bot]
4c41c49a93 auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-08-02 10:29:33 +00:00
Mat Lowery
9d5b8cd13d
kubernetes: Improve namespace usage (#4767)
* Use GetByKey instead of List in GetNamespaceByName.
* Add ToNamespace to reduce memory for namespace cache.

Signed-off-by: Mat Lowery <mlowery@ebay.com>
2021-07-29 23:27:25 -04:00
Jeongwook Park
faa10f61af
Fix typo on kubernetes plugin (#4753)
- modifed -> modified

Signed-off-by: jeongwook-park <jeongwook.park@navercorp.com>
2021-07-14 14:29:41 -04:00
mfleader
38e409b4b6
Correct newdnsController's documented function signature (#4717)
Signed-off-by: mleader <mleader@redhat.com>
2021-06-24 15:18:08 -04:00
Chris O'Haver
a1aafbf405
Add NS+hosts records to xfr response. Add coredns service to test data. (#4696)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-06-14 16:39:40 +02:00
uesyn
4c0fdc3909
plugin/kubernetes: consistently choose EndpointSlices or Endpoints for unstable API (#4647)
* confirm endpointslices is served or not

Signed-off-by: uesyn <suemura@zlab.co.jp>

* Apply suggestions

Signed-off-by: uesyn <suemura@zlab.co.jp>
2021-05-27 08:48:52 -04:00
Miek Gieben
5f41d8eb1f
reverse zone: fix Normalize (#4621)
Make normalize return multiple "hosts" (= reverse zones) when a
non-octet boundary cidr is given.

Added pkg/cidr package that holds the cidr calculation routines; felt
they didn't really fit dnsutil.

This change means the IPNet return parameter isn't needed, the hosts are
all correct. The tests that tests this is also removed: TestSplitHostPortReverse
The fallout was that zoneAddr _also_ doesn't need the IPNet member, that
in turn make it visible that zoneAddr in address.go duplicated a bunch
of stuff from register.go; removed/refactored that too.

Created a plugin.OriginsFromArgsOrServerBlock to help plugins do the
right things, by consuming ZONE arguments; this now expands reverse
zones correctly. This is mostly mechanical.

Remove the reverse test in plugin/kubernetes which is a copy-paste from
a core test (which has since been fixed).

Remove MustNormalize as it has no plugin users.

This change is not backwards compatible to plugins that have a ZONE
argument that they parse in the setup util.

All in-tree plugins have been updated.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-05-17 13:19:54 -07:00
Chris O'Haver
5409379648
consider nil ready as ready (#4632)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-17 16:10:30 -04:00
Chris O'Haver
0a3375e76b
copy unready exclusion to v1beta1 func (#4616)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-10 13:29:56 -04:00
Chris O'Haver
24547447d0
plugin/kubernetes: Support both v1 and v1beta1 EndpointSlices (#4570)
* support v1 and v1beta1 endpointslice

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

* update comments

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-10 09:57:23 -07:00
Chris O'Haver
d6d8a9974b
plugin/kubernetes: fix SOA response for non-apex queries (#4592)
* fix SOA response for non-apex queries

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

* handle mixed case

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

* do full string compare

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-04 11:05:08 +02:00
Chris O'Haver
e1931d48d1
collect endpoint node name from endopintslices (#4581)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-04 10:55:49 +02:00
Chris O'Haver
ef53f372ee
exclude unready endpoints from endpointslices (#4580)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-04-27 12:29:32 -04:00
Chris O'Haver
9f72db12e7
plugin/kubernetes: do endpoint/slice check in retry loop (#4492)
* do endpoint/slice check in retry loop

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-03-26 08:54:39 -04:00
Miek Gieben
74ef6e00f1
transfer: reply with refused (#4510)
* transfer: reply with refused

When the *transfer* plugin is not loaded and of the handlers will still
see the AXFR/IXFR request because it is not intercepted.

They need to reply with REFUSED in that case. Update file, auto and k8s
to do this. Add testcase in the file plugin.

Ideally *erratic* should be moved over as well, but maybe that's
*erratic*

This is a bug fix.

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

* import path

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-09 12:17:34 -08: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
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
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
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
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
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
coredns-auto-go-fmt[bot]
4b87be2a0e auto go fmt 2020-11-11 12:30:39 +00: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
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
ZouYu
c58e4b09fc
Fix golint warnings (#4241)
Include:
1. plugin/forward/type.go:8:2: const typeUdp should be typeUDP
2. plugin/forward/type.go:9:2: const typeTcp should be typeTCP
3. plugin/forward/type.go:10:2: const typeTls should be typeTLS
4. plugin/kubernetes/metrics.go:24:2: var DnsProgrammingLatency should be DNSProgrammingLatency
5. plugin/kubernetes/metrics_test.go:124:102: func parameter clusterIp should be clusterIP

Signed-off-by: zouyu <zouy.fnst@cn.fujitsu.com>
2020-10-28 07:39:56 +01:00