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

Consider implementing "forced" MD foreground deletion #10710

Closed
sbueringer opened this issue May 31, 2024 · 13 comments
Closed

Consider implementing "forced" MD foreground deletion #10710

sbueringer opened this issue May 31, 2024 · 13 comments
Assignees
Labels
area/machinedeployment Issues or PRs related to machinedeployments area/machineset Issues or PRs related to machinesets help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@sbueringer
Copy link
Member

sbueringer commented May 31, 2024

User story

As a user it would be nice if a deleting MD always stays around until all underlying MachineSets and Machines are deleted.

Some details

Today MD already support foreground and background deletion. Foreground deletion has to be explicitly set by users though (e.g. via kubectl ... --cascade=foreground or by setting propagationPolicy to Foreground in DeleteOptions via client-go).

I think a lot of our users are not familiar with the details of foreground vs background deletion and how to enable it (e.g. we didn't even consider setting propagationPolicy when deleting MachineDeployments in the Cluster topology controller).

In general I think it would be better if a MD stays around until all child objects (MS / Machines) are gone (it's easier to figure out if there are still "parts" of the MD that exist). On the other side it would be nice for us if we don't have to maintain both foreground and background deletion. It makes it easier to reason through the deletion process in other controller, e.g. like the MD+MS topology controllers doing template garbage collection (we have 0 test coverage for foreground deletion there).

Additional detail: Machine & Cluster deletion today only support foreground deletion independent of what users specify (basically by implementing their own finalizer + reconcileDelete logic)

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 31, 2024
@sbueringer
Copy link
Member Author

cc @vincepri @enxebre @fabriziopandini @chrischdi

I think I got the most important points.

@vincepri
Copy link
Member

/area machineset
/area machinedeployment
/triage accepted

@k8s-ci-robot k8s-ci-robot added area/machineset Issues or PRs related to machinesets area/machinedeployment Issues or PRs related to machinedeployments triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 31, 2024
@fabriziopandini
Copy link
Member

+1
/help

@k8s-ci-robot
Copy link
Contributor

@fabriziopandini:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

+1
/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label May 31, 2024
@fabriziopandini fabriziopandini added the kind/feature Categorizes issue or PR as related to a new feature. label May 31, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label May 31, 2024
@fabriziopandini fabriziopandini added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels May 31, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates an issue lacks a `priority/foo` label and requires one. label May 31, 2024
@fabriziopandini fabriziopandini removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label May 31, 2024
@vincepri
Copy link
Member

A couple more points:

  • Having a familiar experience, the same way the cluster behaves on deletion is a better UX than what we have today.
  • The MachineDeployment doesn't provide any further information after it gets deleted, if Machine(s) are stuck in deletion, there is no signal and objects may hang around
  • It's not super intuitive, in general, to use foreground deletion with clients

@enxebre
Copy link
Member

enxebre commented May 31, 2024

The scenarios 1 and 3 described by Stefan here where propagation after giving a deletion timestamp might come in handy would benefit from enforced foreground as well #10589 (comment)

@Dhairya-Arora01
Copy link
Contributor

Dhairya-Arora01 commented Jun 1, 2024

@sbueringer ..... in reconcileDelete MDs would check for descendant MS and would delete them.... similarly we need to have finalizer and reconcileDelete in MS as well that would look for descendant Machines and once all the owned Machines get deleted, the finalizer on MS would be removed and it would deleted.... then the same thing will happen with owner MD.....

Its like a chain of foreground deletions-> MD -> MS -> Machines......
Do you think I'm on the correct path? If yes, I can start implementing this.....

@sbueringer
Copy link
Member Author

Do you think I'm on the correct path? If yes, I can start implementing this.....

Yup sounds perfect. Feel free to go ahead (& assign yourself the issue)

@Dhairya-Arora01
Copy link
Contributor

/assign

@chrischdi
Copy link
Member

assign

@chrischdi
Copy link
Member

/assign

@sbueringer
Copy link
Member Author

/close

#11174 was merged

@k8s-ci-robot
Copy link
Contributor

@sbueringer: Closing this issue.

In response to this:

/close

#11174 was merged

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/machinedeployment Issues or PRs related to machinedeployments area/machineset Issues or PRs related to machinesets help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants