aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/kubernetes.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-19plugin/kubernetes: filter ExternalName services from matching double ↵Gravatar Dan Wilson 1-2/+2
subdomain wildcard (#6162) remove double subdomain reference from review feedback not subdoman Signed-off-by: emaildanwilson <dan@controlplane.com> Co-authored-by: emaildanwilson <dan@controlplane.com>
2023-06-12plugin/kubernetes: Remove Endpoint and EndpointSlice v1beta Support (#6147)Gravatar Chris O'Haver 1-80/+0
* remove endpoint and endpointslicev1beta watch support Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * adjust readme Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * informer object changes Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * remove unused funcs Signed-off-by: Chris O'Haver <cohaver@infoblox.com> --------- Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-12-13plugin/kubernetes: error NXDOMAIN for TXT lookups (#5737)Gravatar LAMRobinson 1-5/+13
plugin/kubernetes: fix NXDOMAIN/NOERROR responses for TXT queries Signed-off-by: Laurence Robinson <laurence_robinson@live.co.uk> Co-authored-by: Laurence Robinson <laurence.robinson@deshaw.com>
2022-11-04dont match external services when endpoint is specified (#5734)Gravatar Chris O'Haver 1-0/+4
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-08-30plugin/k8s_external: Resolve headless services (#5505)Gravatar TomasKohout 1-2/+2
*add option for resolving headless Services without external IPs in k8s_external Signed-off-by: Tomas Kohout <tomas.kohout1995@gmail.com>
2022-08-30chore: remove duplicate word in comments (#5592)Gravatar Abirdcfly 1-1/+1
* chore: remove duplicate word in comments Signed-off-by: Abirdcfly <fp544037857@gmail.com> * auto go mod tidy Signed-off-by: coredns[bot] <bot@bot.coredns.io> Signed-off-by: Abirdcfly <fp544037857@gmail.com> Signed-off-by: coredns[bot] <bot@bot.coredns.io> Co-authored-by: coredns[bot] <bot@bot.coredns.io>
2022-07-10add golangci-lint linter (#5499)Gravatar Ondřej Benkovský 1-3/+0
2022-05-03fix k8s start up timeout ticker (#5361)Gravatar Chris O'Haver 1-2/+0
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-03-07plugin/k8s_external: implement zone transfers (#4977)Gravatar Chris O'Haver 1-1/+1
Implement transfer for k8s_external. Notifies not supported. Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-03-03use tickers instead of time.After to avoid memory leak (#5220)Gravatar Chris O'Haver 1-7/+13
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-22plugin/etcd+kubernetes: Persist truncated state to client if CNAME lookup ↵Gravatar Chris O'Haver 1-2/+6
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-22kubernetes: log server start delay and api connection failures (#5044)Gravatar Chris O'Haver 1-0/+14
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-14auto go fmtGravatar coredns[bot] 1-2/+0
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2022-02-09Revert "add wildcard warnings (#5030)" (#5167)Gravatar Chris O'Haver 1-1/+0
This reverts commit 744468ea78e278bb59c1e50673ff5028ebea539c.
2022-02-09remove wildcard query functionality (#5019)Gravatar Chris O'Haver 1-49/+17
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-12-09add wildcard warnings (#5030)Gravatar Chris O'Haver 1-0/+1
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-12-01plugin/kubernetes: clean code (#5017)Gravatar xuweiwei 1-5/+5
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.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-10plugin/kubernetes: Support both v1 and v1beta1 EndpointSlices (#4570)Gravatar Chris O'Haver 1-8/+21
* 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-03-26plugin/kubernetes: do endpoint/slice check in retry loop (#4492)Gravatar Chris O'Haver 1-20/+75
* do endpoint/slice check in retry loop Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
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-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>
2020-12-21plugin/kubernetes: Add support for dual stack ClusterIP Services (#4339)Gravatar Chris O'Haver 1-19/+19
* 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-10-30plugin/kubernetes: Watch EndpointSlices (#4209)Gravatar Chris O'Haver 1-1/+18
* 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-09-24Cherry-pick: Implement notifies for transfer plugin (#3972) (#4142)Gravatar Yong Tang 1-1/+6
* 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-07-08Revert "Implement notifies for transfer plugin (#3972)" (#3995)Gravatar Yong Tang 1-6/+1
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 1-1/+6
* 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-03-30Update k8s.io/[api|apimachinery|client-go] to v0.18.0 (#3796)Gravatar Yong Tang 1-2/+2
* 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-01-31plugin/kubernetes: fix metadata (#3642)Gravatar Chris O'Haver 1-1/+1
Automatically submitted.
2019-12-19Bump kubernetes plugin schema version (#3554)Gravatar Antonio Ojea 1-1/+1
The Kubernetes DNS specification schema version was updated to 1.1.0 in order to support IPv6 Signed-off-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
2019-09-05plugin/kubernetes: Handle multiple local IPs and bind (#3208)Gravatar Chris O'Haver 1-6/+4
* use all local IPs * mult/bind ips * gofmt + boundIPs fix * fix no matching endpoint case * don't duplicate NS records in answer * fix answer dedup * fix comment * add multi local ip test case
2019-08-23plugin/k8s_external/kubernetes: handle NS records (#3160)Gravatar Chris O'Haver 1-15/+23
* fix external ns records * use k8s service name for ns record * update test, add func comment * expand nsAddrs() test cases * support local ipv6 ip * use less confusing pod ip in test
2019-08-21typo fixes (#3169)Gravatar Chris O'Haver 1-1/+1
* spelling fixes * its/it's
2019-08-15fix typos in kubernetes.go (#3132)Gravatar AllenZMC 1-1/+1
2019-06-09remove unused functions (#2873)Gravatar Chris O'Haver 1-27/+0
2019-06-01plugin/kubernetes: skip deleting pods (#2853)Gravatar Miek Gieben 1-5/+0
Don't add pods to our internal cache that are being deleted. This saves a field in the struct as well. Add (extra) comments about adding fields to the object/{Pod,Service,Endpoint} structs. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-07make ignore empty work with ext svc types (#2823)Gravatar Chris O'Haver 1-1/+3
2019-05-01kubernetes: never respond with NXDOMAIN for authority label (#2769)Gravatar Billie Cleek 1-2/+10
* kubernetes: never respond with NXDOMAIN for authority label Return a nodata response when trying to resolve the authority's label for a record type that doesn't match the record type of the authority. This guards against poisoning the authority record by requesting the wrong record type for the authority label. For instance, given an authoritative resolver that uses subdomain delegation for Kubernetes services of a cluster that's configured to use IPv4, the parent may be poisoned by querying it for the authority label of the cluster subdomain with a AAAA record type, which would otherwise (i.e. without this change) return an NXDOMAIN. That is, given cluster.example.com NS 10800 ns.dns.cluster.example.com ns.dns.cluster.example.com A 10800 10.0.1.2 The parent may be poisoned for the SOA TTL by querying it for a AAAA record of ns.dns.cluster.example.com, causing the parent to fail delegate properly until the SOA TTL lapses. * kubernetes: add tests for authority queries
2019-03-26Remove context.Context from request.Request (#2726)Gravatar Miek Gieben 1-5/+6
* Remove context.Context from request.Request This removes the context from request.Request and makes all the changes in the code to make it compile again. It's all mechanical. It did unearth some weirdness in that the context was kept in handler structs which may cause havoc with concurrently handling of requests. Fixes #2721 Signed-off-by: Miek Gieben <miek@miek.nl> * Make test compile Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-22Add `namespace_labels` configuration for kubernetes plugin (#2707)Gravatar Matt Greenfield 1-20/+36
2019-03-11Remove proxy from kubernetes file (#2668)Gravatar Yong Tang 1-1/+0
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-19set ttl for ns records (#2452)Gravatar Chris O'Haver 1-2/+2
2019-01-13Deprecate multiple endpoints for out-of-cluster k8s api (#2454)Gravatar Yong Tang 1-47/+2
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-13Default to upstream to self (#2436)Gravatar Miek Gieben 1-1/+1
* 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>
2018-12-08plugin/kubernetes: smaller map (#2383)Gravatar Miek Gieben 1-2/+2
* 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-08plugin/kubernetes: make prefix key in msg.Service a const (#2378)Gravatar Miek Gieben 1-5/+7
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-11-12dont log error for non existant txt records (#2291)Gravatar Chris O'Haver 1-1/+1
2018-10-11Revert "use keys (#2167)" (#2188)Gravatar Miek Gieben 1-6/+3
This reverts commit 974ed086f25ad45a01947e276e2eb8aa73d007a3.
2018-10-10use keys (#2167)Gravatar Chris O'Haver 1-3/+6