Repository navigation
Conversation
v1 Endpoints is deprecated since Kubernetes 1.33 and the metadata service logs a warning for every watch. Watch discovery.k8s.io/v1 EndpointSlices instead and merge the slices of each Service into the existing Endpoints proto, so the rest of the metadata pipeline doesn't change. Terminating endpoints are left out like the Endpoints API does, and pods in dual-stack services are only listed once. The metadata and updater roles get read access to endpointslices. Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
cvas22
requested a deployment
to
pr-actions-approval
November 13, 2026 09:39 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: Use EndpointSlices instead of v1 Endpoints in the metadata service
The metadata service still watches v1 Endpoints, which is deprecated in 1.33+ and spams deprecation warnings. This switches the watcher to discovery.k8s.io/v1 EndpointSlices. A Service can have several slices, so on every slice event I list that Service's slices from the informer cache and merge them into the same
metadatapb.Endpointsproto as before. That way the EndpointsUpdateProcessor, the store and what PEMs/Kelvin receive stay the same.A few things worth a look. Terminating endpoints are dropped and not-ready ones go to NotReadyAddresses, which matches what the Endpoints controller did. Dual-stack services get one slice per IP family, so a pod is only added once, from the IPv4 slice. Deleting a slice while others remain is sent as a modify, and only the last one is sent as a delete. The UID on the merged object is now the Service's UID (from the slices' owner ref) instead of the Endpoints object's UID, so it lines up with the ServiceUpdateProcessor. Happy to keep the old behavior if something depends on it.
The metadata and updater roles get get/list/watch on endpointslices. I left the existing endpoints permission alone for now in case you want to drop it separately.
I used some help from AI, please don't yell at me. Thx.
Relevant Issues: Fixes #2258
Type of change: /kind cleanup
Test Plan: Added a unit test for
EndpointSlicesToProtocovering ready, not-ready, terminating and dual-stack endpoints, and moved the controller tests over to EndpointSlices.go testpasses forsrc/shared/k8sandsrc/vizier/services/metadata/controllers/k8smeta. I couldn't run bazel locally, so the BUILD changes are by hand.Changelog Message: