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

(bug) better handle deleted cluster #734

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

gianlucam76
Copy link
Member

@gianlucam76 gianlucam76 commented Oct 17, 2024

When cluster is still present but marked as deleted, Sveltos can avoid removing resources (helm charts and/or kubernetes resources) from such a cluster.
Anything else created in the management cluster for such managed cluster still needs to be removed.

Fixes #735
Fixes #732

When cluster is still present but marked as deleted, Sveltos can
avoid removing resources (helm charts and/or kubernetes resources)
from such a cluster.
Anything else created in the management cluster for such managed cluster
still needs to be removed.
@gianlucam76 gianlucam76 merged commit 3554841 into projectsveltos:main Oct 18, 2024
5 checks passed
@gianlucam76 gianlucam76 deleted the deleted-cluster branch October 18, 2024 12:28
@TheNilesh
Copy link

Thank you, @gianlucam76, for addressing this. Would it be possible to create a release that includes this change?

@gianlucam76
Copy link
Member Author

gianlucam76 commented Oct 25, 2024

Hi @TheNilesh yes. I was thinking to do release on Monday. Let me know if this is urgent. I can create a temporary tag with this fix

Though just to clarify, there was nothing wrong with previous Sveltos behaviour.

I added this simply because a bug in the AWS clusterAPI infrastructure provider was not removing a deleted cluster. And so another user ended up with deleted Profile also remaining in the management cluster.
If the deleted clusterAPI is removed correctly, then Sveltos has no problem.

With that I mean, that even with 0.39.0 and 0.40.0, if a ClusterAPI cluster is deleted, Sveltos already cleans resources in the management cluster correctly.

@TheNilesh
Copy link

Thank you! A Monday release should work.

We’re currently using version v0.39.0 of the Sveltos-addon controller and consistently notice that addons aren’t always removed after a CAPI cluster is deleted. From the logs, it appears Sveltos is still attempting to reach the deleted control plane. It seems that, after a certain number of attempts, it stops trying and leaves the addons in place indefinitely. While my observation could be incorrect, I built a new image of the addon-controller with the commits from this PR, and cleanup worked as expected.

Could you please confirm if this fix addresses the same issue or a different one?

@gianlucam76
Copy link
Member Author

Thanks. For me to properly answer, can you tell me if your deleted CAPI cluster is still present in the management cluster (in deleted state)?

@TheNilesh
Copy link

No, it is gone.

@gianlucam76
Copy link
Member Author

Thanks. That's strange. If you were deploying just helm charts, v0.39.0 should already have fix. Meaning Sveltos should have correctly removed all resources deployed in the management cluster.

In any case, this fix better handles that situation. Sveltos, when detects cluster is marked as deleted (even though still present) does not even try to access it and simply moves forwards removing resources in the management cluster (if any).

@TheNilesh
Copy link

TheNilesh commented Oct 25, 2024

I’m unable to reproduce the issue now. It may be a different problem. If it occurs again, should I create a new GH issue and post logs there?

@gianlucam76
Copy link
Member Author

yes please. If you get to repro please file a GH issue with logs. Thanks

@gianlucam76
Copy link
Member Author

gianlucam76 commented Oct 28, 2024

@TheNilesh just released v0.41.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants