Skip to content

Conversation

jkremser
Copy link
Contributor

Fixes #1297

@jkremser jkremser requested a review from a team as a code owner May 20, 2025 12:23
@jkremser jkremser changed the title Migration to EndpointSlices [wip] Migration to EndpointSlices May 20, 2025
@jkremser jkremser force-pushed the endpointSlices branch 6 times, most recently from b835ef9 to b164bc8 Compare May 20, 2025 16:16
Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
@wozniakjan wozniakjan changed the title [wip] Migration to EndpointSlices [wip] migrate from v1.Endpoints to discoveryv1.EndpointSlices Sep 16, 2025
@wozniakjan wozniakjan force-pushed the endpointSlices branch 2 times, most recently from fc398ef to 13b830c Compare September 16, 2025 12:36
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
@wozniakjan wozniakjan changed the title [wip] migrate from v1.Endpoints to discoveryv1.EndpointSlices migrate from v1.Endpoints to discoveryv1.EndpointSlices Sep 17, 2025
@wozniakjan wozniakjan requested a review from Copilot September 18, 2025 07:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates from Kubernetes v1.Endpoints to discovery/v1.EndpointSlices API to modernize the endpoint discovery mechanism. This is a breaking change that improves compatibility with newer Kubernetes versions but may break support for older clusters.

  • Migration from v1.Endpoints to discoveryv1.EndpointSlices across the entire codebase
  • Update RBAC permissions to access discovery.k8s.io API group instead of core v1
  • Refactor endpoint data structure access patterns to use EndpointSlice.Endpoints instead of Endpoints.Subsets

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/checks/interceptor_websocket/interceptor_websocket_test.go Remove version tag from test container image
scaler/queue_pinger_test.go Update test imports and function signatures to use EndpointSlice
scaler/main.go Update RBAC annotation for EndpointSlices API access
pkg/k8s/fake_endpoints.go Refactor fake endpoint creation to use EndpointSlice structure
pkg/k8s/endpoints_test.go Update tests to use EndpointSlice data structures and assertions
pkg/k8s/endpoints_cache_informer.go Migrate informer to use EndpointSlice with label-based service selection
pkg/k8s/endpoints_cache_fake.go Update fake cache implementation for EndpointSlice compatibility
pkg/k8s/endpoints_cache.go Update interface signature to return EndpointSlice
pkg/k8s/endpoints.go Migrate endpoint retrieval functions to use EndpointSlice API
operator/controllers/http/ping_test.go Update test to handle EndpointSlice address structure
interceptor/proxy_handlers_integration_test.go Update integration tests to use EndpointSlice objects
interceptor/main.go Update RBAC annotation for EndpointSlices API access
interceptor/forward_wait_func_test.go Update test helper functions to create EndpointSlice objects
interceptor/forward_wait_func.go Update endpoint counting logic for EndpointSlice structure
config/scaler/role.yaml Update RBAC role to access discovery.k8s.io/endpointslices
config/interceptor/role.yaml Update RBAC role to access discovery.k8s.io/endpointslices
CHANGELOG.md Document breaking change migration from v1.Endpoints to EndpointSlices

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
@wozniakjan wozniakjan merged commit 9047390 into kedacore:main Sep 18, 2025
18 of 19 checks passed
malpou pushed a commit to malpou/http-add-on that referenced this pull request Oct 4, 2025
* Migration to EndpointSlices

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>

* finish migration from v1.Endpoints to discoveryv1.EndpointSlices

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

* handle multiple EndpointSlices per service

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

* remove deletecollection rbac for endpoint slices

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

---------

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com>
malpou pushed a commit to malpou/http-add-on that referenced this pull request Oct 4, 2025
* Migration to EndpointSlices

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>

* finish migration from v1.Endpoints to discoveryv1.EndpointSlices

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

* handle multiple EndpointSlices per service

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

* remove deletecollection rbac for endpoint slices

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

---------

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com>
malpou pushed a commit to malpou/http-add-on that referenced this pull request Oct 4, 2025
* Migration to EndpointSlices

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>

* finish migration from v1.Endpoints to discoveryv1.EndpointSlices

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

* handle multiple EndpointSlices per service

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

* remove deletecollection rbac for endpoint slices

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>

---------

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v1.Endpoints deprecation
3 participants