fix: Remove deprecated Endpoints store#2961
Conversation
|
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rexagod The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Removes the deprecated core/v1 Endpoints metrics store (and its documentation/tests) in favor of the existing EndpointSlice-based implementation to prevent Kubernetes deprecation warning log floods and keep kube-state-metrics aligned with supported APIs.
Changes:
- Removed the Endpoints store implementation and its unit tests.
- Updated the store builder and e2e tests to no longer reference/endow the Endpoints resource.
- Removed Endpoint metrics documentation and the link from the docs index.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/main_test.go | Drops endpoint from the set of known non-default resources in the e2e “default collector” assertions. |
| internal/store/endpoint.go | Removes the Endpoints metric families and list/watch wiring. |
| internal/store/endpoint_test.go | Removes unit tests for the Endpoints metrics output. |
| internal/store/builder.go | Removes the endpoints store from availableStores and deletes the builder function. |
| docs/README.md | Removes the “Endpoint Metrics” documentation link from the exposed metrics index. |
| docs/metrics/service/endpoint-metrics.md | Deletes the Endpoint metrics reference page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "cronjobs": func(b *Builder) []cache.Store { return b.buildCronJobStores() }, | ||
| "daemonsets": func(b *Builder) []cache.Store { return b.buildDaemonSetStores() }, | ||
| "deployments": func(b *Builder) []cache.Store { return b.buildDeploymentStores() }, | ||
| "endpoints": func(b *Builder) []cache.Store { return b.buildEndpointsStores() }, | ||
| "endpointslices": func(b *Builder) []cache.Store { return b.buildEndpointSlicesStores() }, | ||
| "horizontalpodautoscalers": func(b *Builder) []cache.Store { return b.buildHPAStores() }, |
| "cronjobs": func(b *Builder) []cache.Store { return b.buildCronJobStores() }, | ||
| "daemonsets": func(b *Builder) []cache.Store { return b.buildDaemonSetStores() }, | ||
| "deployments": func(b *Builder) []cache.Store { return b.buildDeploymentStores() }, | ||
| "endpoints": func(b *Builder) []cache.Store { return b.buildEndpointsStores() }, | ||
| "endpointslices": func(b *Builder) []cache.Store { return b.buildEndpointSlicesStores() }, | ||
| "horizontalpodautoscalers": func(b *Builder) []cache.Store { return b.buildHPAStores() }, |
The v1 Endpoints API is deprecated in Kubernetes 1.33+ in favor of discovery.k8s.io/v1 EndpointSlice. When the endpoints resource is enabled, every List/Watch call triggers a deprecation warning that floods logs with ~10K+ repeated messages, obscuring genuinely important entries. The endpointslices store has been the default since v2.14.0 and provides a superset of functionality. This removes the endpoints store entirely to eliminate the deprecation warning flood. Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
|
/triage accepted |
The v1 Endpoints API is deprecated in Kubernetes 1.33+ in favor of discovery.k8s.io/v1 EndpointSlice. When the endpoints resource is enabled, every List/Watch call triggers a deprecation warning that floods logs with ~10K+ repeated messages, obscuring genuinely important entries.
The endpointslices store has been the default since v2.14.0 and provides a superset of functionality. This removes the endpoints store entirely to eliminate the deprecation warning flood.