-
Notifications
You must be signed in to change notification settings - Fork 26
Add prevent deleting annotation #48
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
Add prevent deleting annotation #48
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
9961632 to
6c624f3
Compare
| } | ||
|
|
||
| func (r *ReconcileMachine) isDeleteAllowed(machine *machinev1.Machine) bool { | ||
| if r.nodeName == "" || machine.Status.NodeRef == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we are removing this logic which ensures that the node on which this controller is running, will not be deleted?
Please update the PR description as well to reflect this change. Currently description sems to suggest that additionally annotation ios going to be supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can definitely imagine scenarios where the MAO node would need to be deleted, however machine-healthcheck has a special case for masters that prevents it from asking for their deletion.
|
This PR seems to be solving the problem similar to the one being discussed here, openshift/machine-api-operator#333 |
6c624f3 to
1c70002
Compare
1c70002 to
485ee23
Compare
Why we need this: This commit adds the ability to prevent processing of deletion of machine-objects when the annotation is present. This is particularly useful when an automated remediation mechanism is implemented to serve as a way for administrators to indicate they do not wish a particular machine to be remediated for whatever reason.
485ee23 to
920a788
Compare
|
This will have an unfortunate effect of keeping a machine in Wrt. machine health checker this will help to filter out such machines so they will never get deleted. |
|
this (the annotation, its creation/deletion/lifecycle and what to do/no to do when is present) should be handled by MHC/remediation/upper-level-consumer so they shape its business logic on top of immutable operations |
Yeah, if we want this annotation, the correct place to handle it would be in an admission webhook so we can reject the delete outright. |
@ingvagabund I think this is primarily opt-in, so there's not much reason for a bug to be filed if a user creates this annotation. Maybe machinesets need to be updated to account for this, but I don't think that's a blocker. We need to give users a way on a per-machine basis to prevent deletion. This prevention might be necessary for a variety of reasons such as preserving an instance for security audits, etc. @bison I think this annotation could definitely be used in tandem with a validating webhook to avoid persisting in delete forever (which we should have an alarm on, as I suggested previously). As far as the remediation layer, I don't want to rely on a 3rd party respecting this annotation, because what if it doesn't? The user should always be right and the buck stops with the machine-controller. |
|
@michaelgugino: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
|
/bugzilla refresh |
|
@openshift-bot: No Bugzilla bug is referenced in the title of this pull request. DetailsIn response to this:
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/test-infra repository. |
|
/bugzilla refresh |
|
@openshift-bot: No Bugzilla bug is referenced in the title of this pull request. DetailsIn response to this:
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/test-infra repository. |
|
Is this still a PR we want to pursue, or should it just be closed after all this time? |
|
please let's elaborate an enhancement PR and reopen against master if still relevant |
|
FYI: generic upstream discussion: kubernetes-sigs#1514 |
Why we need this:
This commit adds the ability to prevent processing of deletion
of machine-objects when the annotation is present. This
is particularly useful when an automated remediation mechanism
is implemented to serve as a way for administrators to
indicate they do not wish a particular machine to be
remediated for whatever reason.