aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-08-02auto go fmtGravatar coredns[bot] 1-2/+2
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-07-29kubernetes: Improve namespace usage (#4767)Gravatar Mat Lowery 8-41/+97
* 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-14Fix typo on kubernetes plugin (#4753)Gravatar Jeongwook Park 1-6/+6
- modifed -> modified Signed-off-by: jeongwook-park <jeongwook.park@navercorp.com>
2021-06-24Correct newdnsController's documented function signature (#4717)Gravatar mfleader 1-1/+1
Signed-off-by: mleader <mleader@redhat.com>
2021-06-14Add NS+hosts records to xfr response. Add coredns service to test data. (#4696)Gravatar Chris O'Haver 3-3/+49
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-27plugin/kubernetes: consistently choose EndpointSlices or Endpoints for ↵Gravatar uesyn 1-13/+23
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-17reverse zone: fix Normalize (#4621)Gravatar Miek Gieben 2-49/+1
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-17consider nil ready as ready (#4632)Gravatar Chris O'Haver 1-2/+11
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-10copy unready exclusion to v1beta1 func (#4616)Gravatar Chris O'Haver 1-0/+3
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-10plugin/kubernetes: Support both v1 and v1beta1 EndpointSlices (#4570)Gravatar Chris O'Haver 3-12/+106
* 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-04plugin/kubernetes: fix SOA response for non-apex queries (#4592)Gravatar Chris O'Haver 3-2/+17
* 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-04collect endpoint node name from endopintslices (#4581)Gravatar Chris O'Haver 1-1/+3
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-04-27exclude unready endpoints from endpointslices (#4580)Gravatar Chris O'Haver 1-0/+3
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-03-26plugin/kubernetes: do endpoint/slice check in retry loop (#4492)Gravatar Chris O'Haver 4-73/+140
* do endpoint/slice check in retry loop Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-03-09transfer: reply with refused (#4510)Gravatar Miek Gieben 1-0/+2
* 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-02-25plugin/kubernetes: don't return when ServerVersion return an error (#4490)Gravatar Miek Gieben 1-9/+8
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-09make kubernetes plugin kubeconfig argument 'context' optional (#4451)Gravatar Jun Chen 3-9/+28
Signed-off-by: answer1991 <answer1991.chen@gmail.com>
2021-01-26Corrected detection of K8s minor version (#4430)Gravatar Lars Ekman 1-1/+1
Fixes #4428 Signed-off-by: Lars Ekman <lars.g.ekman@est.tech>
2021-01-24Fix import ordering presubmit test (#4422)Gravatar Miek Gieben 1-0/+1
Automatically submitted.
2021-01-06Fix golint issue caused by typo (#4365)Gravatar Guangwen Feng 1-1/+1
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2020-12-21plugin/kubernetes: Add support for dual stack ClusterIP Services (#4339)Gravatar Chris O'Haver 13-109/+202
* 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-16[feat]:update the kubernets.go fix npe (#4338)Gravatar Jiang Biao 1-1/+4
Signed-off-by: Biao Jiang <standup-jb@github.com> Co-authored-by: biao.jiang@ximalaya.com <biao.jiang@ximalaya.com>
2020-12-01plugin/kubernetes: Fix dns programming duration metric (#4255)Gravatar Chris O'Haver 9-198/+168
* 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-11-11auto go fmtGravatar coredns-auto-go-fmt[bot] 1-1/+1
2020-10-30plugin/kubernetes: Watch EndpointSlices (#4209)Gravatar Chris O'Haver 15-175/+367
* 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-28docs: move Also See to See Also (#4245)Gravatar Miek Gieben 1-1/+1
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-28Fix golint warnings (#4241)Gravatar ZouYu 2-8/+8
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-09-24Cherry-pick: Implement notifies for transfer plugin (#3972) (#4142)Gravatar Yong Tang 8-401/+188
* Implement notifies for transfer plugin (#3972) * Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * really fix test Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * Add transfer tests copied and modified from #3452 Signed-off-by: Miek Gieben <miek@miek.nl> * Test correct selection of plugin Signed-off-by: Miek Gieben <miek@miek.nl> * add upstream back in Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * fix test Signed-off-by: Miek Gieben <miek@miek.nl> * properly merge Signed-off-by: Miek Gieben <miek@miek.nl> * Remove plugin/kubernetes/setup_transfer_test.go Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Co-authored-by: Miek Gieben <miek@miek.nl>
2020-09-24For caddy v1 in our org (#4018)Gravatar Miek Gieben 6-6/+6
* For caddy v1 in our org This RP changes all imports for caddyserver/caddy to coredns/caddy. This is the v1 code of caddy. For the coredns/caddy repo the following changes have been made: * anything not needed by us is deleted * all `telemetry` stuff is deleted * all its import paths are also changed to point to coredns/caddy * the v1 branch has been moved to the master branch * a v1.1.0 tag has been added to signal the latest release Signed-off-by: Miek Gieben <miek@miek.nl> * Fix imports Signed-off-by: Miek Gieben <miek@miek.nl> * Group coredns/caddy with out plugins Signed-off-by: Miek Gieben <miek@miek.nl> * remove this file Signed-off-by: Miek Gieben <miek@miek.nl> * Relax import ordering github.com/coredns is now also a coredns dep, this makes github.com/coredns/caddy fit more natural in the list. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix final import Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-22goreport card fixes (#4139)Gravatar Miek Gieben 1-2/+2
This fixes some inefassign as report by Go report card: https://goreportcard.com/report/github.com/coredns/coredns Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-01Fix some typos in comments. (#4100)Gravatar Hu Shuai 4-4/+4
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
2020-07-25using promauto package to ensure all created metrics are properly registered ↵Gravatar Zou Nengren 2-7/+3
(#4025) Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
2020-07-08Revert "Implement notifies for transfer plugin (#3972)" (#3995)Gravatar Yong Tang 8-188/+401
This reverts commit 68f1dd5ddf0451cc3a1b24a72c2965b8d896ffba. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-07-07Implement notifies for transfer plugin (#3972)Gravatar Miek Gieben 8-401/+188
* Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * really fix test Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * Add transfer tests copied and modified from #3452 Signed-off-by: Miek Gieben <miek@miek.nl> * Test correct selection of plugin Signed-off-by: Miek Gieben <miek@miek.nl> * add upstream back in Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * fix test Signed-off-by: Miek Gieben <miek@miek.nl> * properly merge Signed-off-by: Miek Gieben <miek@miek.nl>
2020-06-24format and add newline (#3969)Gravatar Zou Nengren 2-11/+13
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
2020-06-15plugin/kubernetes: fix tombstone unwrapping (#3924)Gravatar Chris O'Haver 4-83/+163
* fix tombstone unwrapping Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-06-12weight for SRV records should be at least 1 (#3931)Gravatar Yang Bo 1-1/+6
Automatically submitted.
2020-05-29k8s_external can now resolve CNAME returned by AWS ELB/NLB (#3916)Gravatar Michael Kashin 1-1/+6
Automatically submitted.
2020-05-15plugin/kubernetes: handle tombstones in default processor (#3890)Gravatar Chris O'Haver 4-25/+45
* handle deletion tombstones in default processor Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * fix terminating pod exclusion Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-05-14plugin/kubernetes: Handle endpoint tombstones (#3887)Gravatar Chris O'Haver 2-13/+31
* check for nil Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * handle tombstone Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * move casting to caller. add comments. Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * more sanding Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * more scrubbing Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * move object unwraping to switch cases Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * oops remove debug Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * remove cruft Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-05-06plugin/kubernetes: Mention remote IP requirement for autopath and metadata ↵Gravatar Chris O'Haver 1-9/+16
in README (#3876) * mention remote IP requirement for autopath and metadata Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * remove whitespace Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-05-05always add client metadata (#3874)Gravatar Chris O'Haver 2-32/+32
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-05-04plugin/kubernetes: Don't panic with metadata enabled and pods mode not ↵Gravatar Chris O'Haver 2-4/+37
verified (#3869) * prevent panic in podWithIP Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * add unit test, correct existing unit test Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * unit tests make more sense this way Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-04-14remove ignored option at kubernetes plugin (#3737)Gravatar Zou Nengren 1-5/+0
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
2020-03-31Update more metrics names (#3799)Gravatar Ben Kochie 2-9/+7
The subsystem of a metric must be it's plugin name. "dns" is reserved for the core. Use a const convention to avoid copy-paste mistakes in naming. Fix dns64 and acl plugin. Signed-off-by: Ben Kochie <superq@gmail.com>
2020-03-30Update k8s.io/[api|apimachinery|client-go] to v0.18.0 (#3796)Gravatar Yong Tang 11-50/+65
* Update k8s.io/[api|apimachinery|client-go] to v0.18.0 This PR updates k8s.io/[api|apimachinery|client-go] to v0.18.0 This PR closes 3791 This PR closes 3792 This PR closes 3793 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Fix test failures Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Fix failed tests Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Fix test failure Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-03-30remove federation (#3794)Gravatar Zou Nengren 3-37/+0
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
2020-03-05Update README.md (#3721)Gravatar Miek Gieben 1-1/+1
Signed-off-by: imba-tjd <imba-tjd@users.noreply.github.com>
2020-02-21return all records with matching ip (#3687)Gravatar Chris O'Haver 2-24/+50
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-01-31plugin/kubernetes: fix metadata (#3642)Gravatar Chris O'Haver 5-9/+9
Automatically submitted.