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

Delete stale EndpointSlices on restart #1430

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

tpantelis
Copy link
Contributor

If a local LH EndpointSlices exists but the corresponding Service doesn't exist, delete the EndpointSlice.

Also, a headless Service can have multiple EndpointSlices so reconcile the LH EndpointSlices on startup to handle a K8s EndpointSlice deleted while the controller wasn't running.

Fixes #1416

@submariner-bot
Copy link
Contributor

🤖 Created branch: z_pr1430/tpantelis/stale_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.

@submariner-bot submariner-bot added the ready-to-test When a PR is ready for full E2E testing label Nov 2, 2023
logger.Infof("The service %q for EndpointSlice \"%s/%s\" does not exist - deleting it",
serviceName, endpointSlice.Namespace, endpointSlice.Name)

err := c.syncer.GetLocalFederator().Delete(ctx, endpointSlice)
Copy link
Member

Choose a reason for hiding this comment

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

I hope this deletes the EndpointSlice from the Broker as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup - the admiral syncer does that.

test.CreateResource(t.cluster1.localServiceExportClient, serviceExport)
t.cluster1.createService()

fmt.Println("*******EPS 1: ", resource.ToJSON(localEndpointSlice))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fmt.Println("*******EPS 1: ", resource.ToJSON(localEndpointSlice))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops

If a local LH EndpointSlices exists but the corresponding Service doesn't
exist, delete the EPS.

Also, a headless Service can have multiple EndpointSlices so reconcile
the LH EndpointSlices on startup to handle a K8s EndpointSlice deleted
while the controller wasn't running.

Fixes submariner-io#1416

Signed-off-by: Tom Pantelis <[email protected]>
@sridhargaddam sridhargaddam enabled auto-merge (rebase) November 2, 2023 12:08
@sridhargaddam sridhargaddam merged commit ace7afe into submariner-io:devel Nov 2, 2023
24 checks passed
@submariner-bot
Copy link
Contributor

🤖 Closed branches: [z_pr1430/tpantelis/stale_eps]

tpantelis added a commit to tpantelis/submariner-website that referenced this pull request Nov 2, 2023
tpantelis added a commit to tpantelis/submariner-website that referenced this pull request Nov 2, 2023
tpantelis added a commit to tpantelis/submariner-website that referenced this pull request Nov 2, 2023
tpantelis added a commit to submariner-io/submariner-website that referenced this pull request Nov 3, 2023
@tpantelis tpantelis deleted the stale_eps branch December 13, 2023 14:01
tpantelis added a commit to tpantelis/submariner-website that referenced this pull request Feb 27, 2024
tpantelis added a commit to submariner-io/submariner-website that referenced this pull request Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service discovery returning IPs of stale endpoints
5 participants