datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

Bump `k8s.io/kube-state-metrics/v2`

Open keisku opened this issue 1 year ago • 8 comments

What does this PR do?

Address two breaking changes in k8s.io/kube-state-metrics/v2 to update from v2.8.2 to v2.12.0

https://github.com/kubernetes/kube-state-metrics/pull/1851

pkg/customresource/registry_factory.go

type RegistryFactory interface {
	// ...
-	MetricFamilyGenerators(allowAnnotationsList, allowLabelsList []string) []generator.FamilyGenerator
+	MetricFamilyGenerators() []generator.FamilyGenerator
	// ...
}

https://github.com/kubernetes/kube-state-metrics/pull/2017

pkg/builder/types/interfaces.go

type BuilderInterface interface {
	// ...
-	WithVPAClient(c vpaclientset.Interface)
	// ...
}

Motivation

  • Bump k8s.io/kube-state-metrics/v2.
  • https://github.com/DataDog/datadog-agent/pull/25103/files#r1586257750

Additional Notes

Currently, we don't filter by MetricFamilyGenerators(allowAnnotationsList, allowLabelsList) since any annotations/labels can be used for label joins, which is hardcode.

  • https://github.com/DataDog/datadog-agent/blob/95cd819f4add36ad4104ecf35d543b4b3db9af50/pkg/collector/corechecks/cluster/ksm/kubernetes_state.go#L266-L274
  • https://github.com/DataDog/datadog-agent/blob/95cd819f4add36ad4104ecf35d543b4b3db9af50/pkg/collector/corechecks/cluster/ksm/kubernetes_state.go#L320-L330

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

keisku avatar Jun 15 '24 09:06 keisku