Skip to content

Use EndpointSlices instead of v1 Endpoints in the metadata service - #2418

Open
cvas22 wants to merge 1 commit into
pixie-io:mainfrom
cvas22:endpointslices
Open

cvas22 wants to merge 1 commit into
pixie-io:mainfrom
cvas22:endpointslices

Conversation

@cvas22

@cvas22 cvas22 commented Nov 13, 2026

Copy link
Copy Markdown

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.Endpoints proto 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 EndpointSlicesToProto covering ready, not-ready, terminating and dual-stack endpoints, and moved the controller tests over to EndpointSlices. go test passes for src/shared/k8s and src/vizier/services/metadata/controllers/k8smeta. I couldn't run bazel locally, so the BUILD changes are by hand.

Changelog Message:

The Vizier metadata service now watches EndpointSlices instead of the deprecated v1 Endpoints API.

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
cvas22 requested review from a team as code owners November 13, 2026 09:39
@cvas22
cvas22 requested a deployment to pr-actions-approval November 13, 2026 09:39 — with GitHub Actions Waiting

This branch is waiting to be deployed

1 waiting deployment
pr-actions-approval — 4141212a Waiting Nov 13, 2026 by cvas22 via authorize #3161
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.

Remove usage of deprecated K8s v1 Endpoints API

1 participant