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

Derive exported EndpointSlices from K8s EndpointSlices instead of Endpoints #1318

Merged
merged 6 commits into from
Jul 26, 2023

Conversation

tpantelis
Copy link
Contributor

@tpantelis tpantelis commented Jul 21, 2023

See this comment for reasoning.

See individual commits for details.

Fixes #1022
Fixes #755

@submariner-bot
Copy link
Contributor

🤖 Created branch: z_pr1318/tpantelis/lh_eps_from_svc_eps
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

@tpantelis tpantelis force-pushed the lh_eps_from_svc_eps branch 2 times, most recently from 708b185 to 6c6cda6 Compare July 22, 2023 11:44
Copy link
Contributor

@vthapar vthapar left a comment

Choose a reason for hiding this comment

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

Changes look good. Reviewed and tested over weekend. Great work with E2Es too +1. Need a tracking issue to update documentation, esp Troubleshooting Doc.

@@ -302,7 +303,7 @@ func newEndpointSlice(namespace, name, clusterID string, ports []mcsv1a1.Service

return &discovery.EndpointSlice{
ObjectMeta: metav1.ObjectMeta{
Name: name + "-" + namespace + "-" + clusterID,
Name: fmt.Sprintf("%s-%s-%s-%s", name, utilrand.String(5), namespace, clusterID),
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to release note this. Longer name may cause name length related failures for some deployments.

Copy link
Contributor Author

@tpantelis tpantelis Jul 24, 2023

Choose a reason for hiding this comment

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

yeah I thought about that. I think we should use the GenerateName functionality that K8s uses for EndpointSlices with the service name as the prefix. I'm planning to do that next in a followup PR. It's going to require supporting changes in admiral.

Copy link
Member

@skitt skitt left a comment

Choose a reason for hiding this comment

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

This is great! It can go in as-is, I have a couple of minor tweaks if you re-spin.

pkg/constants/constants.go Outdated Show resolved Hide resolved
pkg/agent/controller/types.go Outdated Show resolved Hide resolved
...instead of the service Endpoints.

For headless services, we simply mirror each K8s EndpointSlice,
substituting Globalnet IPs if enabled.

For cluster IP services, we still create a single EndpointSlice
containing the service IP's endpoint address. The ready condition
is detetermined by listing all the EndpointSlices and checking if any
endpoint condition is ready.

Signed-off-by: Tom Pantelis <[email protected]>
...to handle multiple headless EndpointSlices.

Signed-off-by: Tom Pantelis <[email protected]>
@dfarrell07
Copy link
Member

This branch cannot be rebased due to too many changes

I've never seen that before. It looks like there was some recent weirdness along these lines:

https://github.com/orgs/community/discussions/51612

For headless services, the controller retrieves all the EndpointSlices and,
on add/update, passes them to PutEndpointSlices. On delete, i there's no
more PutEndpointSlices, it calls RemoveEndpointSlice, otherwise
PutEndpointSlices.

Signed-off-by: Tom Pantelis <[email protected]>
@tpantelis tpantelis requested review from skitt and vthapar July 25, 2023 22:30
@tpantelis tpantelis merged commit 03004c6 into submariner-io:devel Jul 26, 2023
23 checks passed
@submariner-bot
Copy link
Contributor

🤖 Closed branches: [z_pr1318/tpantelis/lh_eps_from_svc_eps]

@tpantelis tpantelis deleted the lh_eps_from_svc_eps branch August 2, 2023 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants