Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(multicluster): propagate service labels to endpoints #13583

Merged

Conversation

maxbrunet
Copy link
Contributor

When Kubernetes creates endpoints for a service, it propagates the labels from the parent service to the endpoints, allowing these labels to be used for discovery. When using Linkerd mirrored endpoints, this ability was lost until now.

This change simply mimics the vanilla Kubernetes behavior by propagating the remote service labels to mirror endpoints.

kubernetes/kubernetes@a716ea7/pkg/controller/endpoint/endpoints_controller.go#L506

The tests were updated to include a custom label on the services and validate its propagation to the endpoints

When Kubernetes creates endpoints for a service, it propagates the
labels from the parent service to the endpoints, allowing these labels
to be used for discovery. When using Linkerd mirrored endpoints,
this ability was lost until now.

This change simply mimics the vanilla Kubernetes behavior by propagating
the remote service labels to mirror endpoints.

https://github.com/kubernetes/kubernetes/blob/a716ea756d87f60900dbbb500fc27ae30f7bd384/pkg/controller/endpoint/endpoints_controller.go#L506

Signed-off-by: Maxime Brunet <[email protected]>
@maxbrunet maxbrunet requested a review from a team as a code owner January 21, 2025 13:32
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 ; and thanks for going the extra mile with the tests! 🙏

Comment on lines +29 to +31
t.Helper()
t.Run(tc.description, func(t *testing.T) {
t.Helper()
Copy link
Member

Choose a reason for hiding this comment

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

👍

@alpeb alpeb merged commit a979b4a into linkerd:main Jan 23, 2025
38 checks passed
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.

2 participants