Commit graph

39 commits

Author SHA1 Message Date
Ben Kochie
0d6e113f90
Enable Prometheus native histograms (#6524)
Add a NativeHistogramBucketFactor parameter to the use of
`NewHistogramVec` in order to enable use of Prometheus Native
Histograms.

This will store automatically computed sparse buckets in CoreDNS.
If a compatible Prometeus requests native histograms this data will
returned instead of the static buckets.

The default factor of 1.05 should provide high quality resolution data.

Signed-off-by: SuperQ <superq@gmail.com>
2024-03-11 16:09:09 -04:00
miles-to-go
92b7e658e3
add client labels to k8s plugin metadata (#6475)
Signed-off-by: Nolan Miles <nolanpmiles@gmail.com>
2024-03-07 14:34:09 -05:00
rokkiter
6e1263d3d9
fix ports panic (#6179)
Signed-off-by: rokkiter <101091030+rokkiter@users.noreply.github.com>
2023-06-26 09:42:03 -04:00
Chris O'Haver
06cd843918
plugin/kubernetes: Remove Endpoint and EndpointSlice v1beta Support (#6147)
* 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>
2023-06-12 08:22:57 -07:00
Chris O'Haver
68816a42a7
update informer for client-go 0.27 (#6038)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2023-04-20 13:24:06 -04:00
Ondřej Benkovský
c2dbb7141a
add golangci-lint linter (#5499) 2022-07-10 11:06:33 -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
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
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
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
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
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
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
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
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
Hu Shuai
e233f59ee8
Fix some typos in comments. (#4100)
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
2020-09-01 09:10:45 +02:00
Chris O'Haver
d902e85919
plugin/kubernetes: fix tombstone unwrapping (#3924)
* fix tombstone unwrapping

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-06-15 10:15:41 -04:00
Michael Kashin
2e3ef77731
k8s_external can now resolve CNAME returned by AWS ELB/NLB (#3916)
Automatically submitted.
2020-05-29 17:04:23 +00:00
Chris O'Haver
a3aeb3d503
plugin/kubernetes: handle tombstones in default processor (#3890)
* 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-15 09:47:29 -07:00
Chris O'Haver
bb7ee5010e
plugin/kubernetes: Handle endpoint tombstones (#3887)
* 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-14 12:39:40 -07:00
Zou Nengren
dded126317 bump k8s releated library (#3552)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
2019-12-18 05:32:00 -08:00
janluk
d7cdb992b4 Measure and expose DNS programming latency from Kubernetes plugin. (#3171)
For now metric is measure only for headless services. Informer has been slighlty
refactored, so the code can measure latency without storing extra fields on
Endpoint struct.

Signed-off-by: Janek Łukaszewicz <janluk@google.com>

Suggestions from code review

Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
2019-10-04 16:48:43 +01:00
xieyanker
9a5e4fa1a0 fix mis-spelling (#3310)
Signed-off-by: xieyanker <xjsisnice@gmail.com>
2019-09-26 13:19:45 +01:00
Chris O'Haver
3f47fc8ba4
typo fixes (#3169)
* spelling fixes

* its/it's
2019-08-21 16:08:55 -04:00
Xigang Wang
81bba80159 Change the ToEndpoints method comment to replace the Service with Endpoints (#3146) 2019-08-19 09:34:09 -04:00
AllenZMC
d36ca09c97 fix mis-spelling in object.go (#3134) 2019-08-16 09:29:06 -04:00
Anshul Sharma
f9fb9db171 ISSUE-2911 (#2923)
- Remove resyncperiod from Kubernetes plugin
2019-07-03 20:39:12 +01:00
Miek Gieben
3b3fb6f583
plugin/kubernetes: skip deleting pods (#2853)
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-06-01 08:39:52 +01:00
Chris O'Haver
5565ca1c03 kubernetes: bump to client-go 11.0.0 (#2854)
* client-go 11.0.0

* Core moved to CoreV1
2019-05-31 08:01:48 -07: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
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
6ed88fab74 Revert "use keys (#2167)" (#2188)
This reverts commit 974ed086f2.
2018-10-11 16:59:50 -04:00
Chris O'Haver
974ed086f2 use keys (#2167) 2018-10-10 12:28:45 -07:00
Miek Gieben
830e97f800
plugin/kubernetes: allow trimming down of cached items. (#2128)
* Convert to runtime.Object to smaller structs

This adds conversion for all the objects we want to keep in the cache.
It keeps the minimum for CoreDNS to function and throws away the rest.

The conversion:
api.Endpoints -> object.Endpoints
api.Pod       -> object.Pod
api.Serivce   -> object.Service

We needed to copy some client-go stuff to insert a conversion function
into NewIndexInformers.

Some unrelated cleanups in the watch functionality as that needed to be
touched because of the above translation of objects.

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

* Reduce test line-count

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

* ....and fix test

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

* Drop use of append

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

* cosmetic changes

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

* that was a typo

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

* re-introduce append here

We can't really use len() here because we don't know the number before
hand.

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

* comment in better place

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

* Make the timestamp a bool; thats where it is used for

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

* Set incoming object to nil

Explicataliy discard the converted object; we did a deep copy it's
not needed anymore.

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

* Per Chris's comment

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-10-09 21:56:09 +01:00