Decouple Cordoning from Draining to Avoid Uncordoning User-Cordoned Nodes in Preservation Flow - #1119
Decouple Cordoning from Draining to Avoid Uncordoning User-Cordoned Nodes in Preservation Flow#1119thiyyakat wants to merge 10 commits into
Conversation
5299319 to
49ad362
Compare
takoverflow
left a comment
There was a problem hiding this comment.
Thanks for the changes, would it be possible as part of this PR to combine the three separate drain methods? Since it's getting harder to keep track of which one does what specifically.
|
/assign |
This is needed, but I think it should not be done in this PR. The scope and complexity will increase considerably. Not to mention additional time to properly test it. |
Alright, fair enough. That can be tackled later. |
|
[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 |
cbdbb69 to
164b58d
Compare
a8e0897 to
117fb4b
Compare
|
/unhold The PR has been rebased with the preservation flow changes in master. The manual tests mentioned in the PR description have been repeated with the latest changes. |
|
/lgtm Thanks for the work on preservation fixes @thiyyakat ! |
|
LGTM label has been added. DetailsGit tree hash: 502c0449a9b41b7da9426dac74e423c58864bfc6 |
- Add a new function `cordonNode()` and call it in the callers of `RunDrain()``. - For preservation of failed machines, use custom taint to cordon. - Remove function `RunCordonOrUncordon` - Add helper function `updateMachineStatusForDrain` to update machine status during drain across all drain-xxx functions.
- Replace "Cordoning" in descriptions with "Drain" on failure of `cordonNode()`. - Correct return value from `stopPreservationIfActive()`. - Move warning and early return due to empty node above condition check. - Change comment as per reviewer's suggestion. - Change error message on preservation-related taint failure to say "tainting" instead of "cordoning".
- Improve readability of `RemoveTaintOffNode` function call in `stopPreservationIfActive`. - Correct warning on `NotFound` errors in drain functions. - Change log in `cordonNode` to improve clarity. - Add node details to warning when cordoning fails for the force-deletion case.
- Return early from `drainNode` when nodename is empty. Remove `skipDrain`.
- Remove unnecessary assignment to `err`. - Move `cordonNode()` to `node.go` - Return `err` from `cordonNode()` for errors other than NotFound errors.
- Remove `func uncordonNodeIfCordoned`. It is no longer needed. - Modify preservation tests to check for taint - Remove irrelevant code in `drainPreservedNode`. - Remove `getNodePreserveAnnotationValue` since it is not used. - Correct error return statement in `cordonNode`.
…ved with preserve=now in the Running phase, transitions to Failed. This results in the node not being tainted or drained.
Co-authored-by: Gagan <gagan.katla@sap.com>
0baf17e to
344631d
Compare
takoverflow
left a comment
There was a problem hiding this comment.
Just one minor nit, thanks for the changes!
Add log for successful cordoning of node.
6f3a032 to
d9580d3
Compare
|
Changes seem fine to me, thanks for making the changes! |
|
LGTM label has been added. DetailsGit tree hash: 50e773f057fe93069bd9805d6d6ed8ed0b4b6ef0 |
What this PR does / why we need it:
This PR removes the cordoning activity from
RunDrainallowing us to control the two activities separately. This also enables the cordoning during machine preservation's drain to be done without alteringspec.Unschedulable, thereby ensuring a user's manual cordoning/uncordoning is always honoured.The changes in the PR are:
RunCordonOrUncordoncordonNode()and call it in the callers ofRunDrain().updateMachineStatusForDrainto update machine status during drain across all drain-xxx functions.Which issue(s) this PR fixes:
Fixes #1114
Special notes for your reviewer:
IT was run with provider-AWS
The changes were tested by running mcm and mcm-provider-aws locally, targeting a shoot cluster.
Scenarios tested:
kubectl delete mc <machine-name>after labelling machine with force-deletion:TrueRelease note: