Skip to content

Stop watching v1 Endpoints when EndpointSlices are enabled - #15566

Open
pujitha24 wants to merge 1 commit into
linkerd:mainfrom
pujitha24:auto/issue-15561
Open

Stop watching v1 Endpoints when EndpointSlices are enabled#15566
pujitha24 wants to merge 1 commit into
linkerd:mainfrom
pujitha24:auto/issue-15561

Conversation

@pujitha24

Copy link
Copy Markdown
Contributor

Stop watching v1 Endpoints when EndpointSlices are enabled

Problem

The destination controller always started a v1 Endpoints informer (controller/cmd/destination/main.go), even when --enable-endpoint-slices is true (the default). Every consumer of that informer in the watcher package (endpoints_watcher.go, workload_watcher.go, service_publisher.go, port_publisher.go) already branches on enableEndpointSlices and only reads from it when EndpointSlices are disabled, so with the default configuration the informer's LIST/WATCH calls to the v1 Endpoints API served no purpose. On clusters that flag v1 Endpoints as deprecated (e.g. EKS 1.34+), those unused calls flood linkerd-destination's logs with:

level=info msg="Warning: v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice"

This is log noise only; destination service behavior is unchanged before and after this fix, since the v1 Endpoints informer was never actually read from in this mode.

Solution

Only request the k8s.Endpoint informer resource when --enable-endpoint-slices is false, mirroring the conditional resource selection already used for the destination controller's remote-cluster watchers in controller/api/destination/watcher/cluster_store.go.

Validation

Ran, all passing:

go build ./controller/...
go test -race ./controller/cmd/destination/... ./controller/api/destination/... ./controller/k8s/...

This confirms the build and existing behavioral tests (including coverage of the enableEndpointSlices-gated code paths) are unaffected by no longer constructing the v1 Endpoints informer. This was not reproduced against a live cluster exhibiting the deprecation warning; the fix follows directly from removing the only remaining unconditional consumer of the v1 Endpoints API in this code path, which is what triggers the apiserver's deprecation warning on List/Watch.

Fixes #15561

Signed-off-by: Pujitha Paladugu 10557236+pujitha24@users.noreply.github.com


AI assistance: this change was drafted with Claude Code.

Problem

The destination controller always started a v1 Endpoints informer
(controller/cmd/destination/main.go), even when
--enable-endpoint-slices is true (the default). Every consumer of
that informer in the watcher package (endpoints_watcher.go,
workload_watcher.go, service_publisher.go, port_publisher.go) already
branches on enableEndpointSlices and only reads from it when
EndpointSlices are disabled, so with the default configuration the
informer's LIST/WATCH calls to the v1 Endpoints API served no
purpose. On clusters that flag v1 Endpoints as deprecated (e.g. EKS
1.34+), those unused calls flood linkerd-destination's logs with:

  level=info msg="Warning: v1 Endpoints is deprecated in v1.33+;
  use discovery.k8s.io/v1 EndpointSlice"

This is log noise only; destination service behavior is unchanged
before and after this fix, since the v1 Endpoints informer was never
actually read from in this mode.

Solution

Only request the k8s.Endpoint informer resource when
--enable-endpoint-slices is false, mirroring the conditional
resource selection already used for the destination controller's
remote-cluster watchers in controller/api/destination/watcher/cluster_store.go.

Validation

Ran, all passing:

  go build ./controller/...
  go test -race ./controller/cmd/destination/... ./controller/api/destination/... ./controller/k8s/...

This confirms the build and existing behavioral tests (including
coverage of the enableEndpointSlices-gated code paths) are unaffected
by no longer constructing the v1 Endpoints informer. This was not
reproduced against a live cluster exhibiting the deprecation warning;
the fix follows directly from removing the only remaining unconditional
consumer of the v1 Endpoints API in this code path, which is what
triggers the apiserver's deprecation warning on List/Watch.

Report: linkerd#15561
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
@pujitha24
pujitha24 requested a review from a team as a code owner August 11, 2026 07:44
@pujitha24

Copy link
Copy Markdown
Contributor Author

Just checking in on this one — it's still rebased and green (DCO passing, no merge conflicts); happy to make any changes if something would make it easier to review.

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.

Warning: v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice

1 participant