Trigger node deletion when machine is deleted - #1102
Conversation
thiyyakat
left a comment
There was a problem hiding this comment.
Thanks for the changes. Just two comments. PTAL.
|
The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle stale |
|
The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle rotten |
3a45864 to
9864805
Compare
|
Thanks for addressing the comments. |
|
LGTM label has been added. DetailsGit tree hash: 7c6a71242f80f6ef4851c138c0bece6fce8dbd6c |
|
/assign |
|
[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 |
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: 5518b0ad517494d0016de9dc24f7dd9aec43f5b1 |
takoverflow
left a comment
There was a problem hiding this comment.
Thanks for the PR, have some queries/suggestion PTAL
| } | ||
| c.enqueueMachineTermination(machine, "handling terminating machine object DELETE event") | ||
|
|
||
| // Node retains finalizer here, removed by reconcileClusterNodeKey once DeletionTimestamp is set |
There was a problem hiding this comment.
Why is the finalizer being retained here, wouldn't it make sense to speed up cleanup by removing it as well? Why wait for node reconciliation to happen?
Is it for convenience or there's some value in preserving the finalizer still?
There was a problem hiding this comment.
There was a pre-existing mechanism to handle the finalizer removal (So that any nodes that do not have a machine do not get a finalizer, added as part of #1065).
So I did not add it here, as the finalizer is removed anyways
There was a problem hiding this comment.
Yes but AFAICS the current reconcileClusterNodeKey doesn't have any finalizer removal logic
Please correct me if I'm wrong but the only place we currently actively remove the finalizer from the node and issue deletion is deleteNodeObject which is part of triggerDeletionFlow.
| // transient fetch errors will be eventually requeued by the update handler due to kubelet updates. | ||
| // Ignore node updates without an associated machine, except when the node is being | ||
| // deleted, then remove the MCM finalizer to unblock deletion. Retry only for | ||
| // errors other than errNoMachineMatch; transient fetch errors will be eventually |
There was a problem hiding this comment.
If there's a transient error while fetching the machine for the node, and node deletion was triggered via kubectl delete node, we can prematurely remove the finalizers now right?
Or there's no possibility of getting no machine match (when there is a machine) because we're relying on listers?
There was a problem hiding this comment.
NoMachineMatch (when there is a machine) is theoretically possible but is probably very rare.
Could add an extra API server fetch to actually check if the machine is truly gone, but this might be unnecessary? Not sure, WDYT
There was a problem hiding this comment.
That's why I thought maybe the finalizer removal and node deletion could happen as a unit as part of machine on delete event similar to how its done in deleteNodeObject. So all this checking here becomes unnecessary.
Not proposing that this is how it should be done, just pitching an alternative to see if there's any pros/cons of doing it either way.
What this PR does / why we need it:
"Creating machine on cloud provider"to"VM created on cloud provider. Waiting for node registration", so the status accurately reflects which stage the machine is in.Which issue(s) this PR fixes:
Fixes #1044, #1064
Tests:
Passed unit tests
Manual tests performed by deleting node manually
For #1064, machine during creation has message
Release note: