Enable intrange linter to enforce modern Go range syntax over
traditional for loops, by converting:
for i := 0; i < n; i++
to:
for i := range n
Adding type conversions where needed for compatibility
with existing uint64 parameters.
Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
Enable copyloopvar linter and remove redundant variable
shadowing in Kubernetes plugin metadata handling. This pattern is
no longer needed in Go 1.22+ where loop variables are automatically
captured correctly in closures.
Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
* kubernetes: add multicluster support
Add multicluster support via Multi-Cluster Services API (MCS-API) via a
new option `multiclusterZones` in the kubernetes plugin.
When some multicluster zones are passed to the kubernetes plugin, it
will start watching the ServiceImport objects and its associated
EndpointSlices.
Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
* kubernetes: implement xfr support for multicluster zones
Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
---------
Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
Don't explicitly set `RetryOnError` to `false`. It won't exist in the
next version of the k8s api and it won't make a difference in this code
since the struct would default to that.
Signed-off-by: Kevin Lyda <kevin@lyda.ie>
In kubernetes' audit logs you'll see:
"userAgent":"coredns/v0.0.0 (linux/amd64) kubernetes/$Format"
This change adds a userAgent to the requests made by CoreDNS against the kubernetes API:
"userAgent":"CoreDNS/v1.11.1 git_commit:ae2bbc29be1aaae0b3ded5d188968a6c97bb3144 (linux/amd64/go1.22)"
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
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>
* Drop obsolete client-go auth plugins
The OpenStack plugin is no longer available, even in version 0.24.4 of
client-go; see
https://github.com/kubernetes/client-go/blob/v0.24.4/plugin/pkg/client/auth/openstack/openstack_stub.go
It is replaced by the client-keystone-auth credential plugin. The
plugin has been entirely removed in client-go 0.26.0, which breaks the
build when any other dependency pulls in client-go 0.26.0 or later.
The GCP plugin is deprecated in K8s 1.22+ and unavailable in 1.26+
(although it is still stubbed in client-go 0.26.0). Is it replaced by
the gke-gcloud-auth-plugin credential plugin.
Signed-off-by: Stephen Kitt <skitt@redhat.com>
* Update plugin/kubernetes/setup.go
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
* 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>