gardener / machine-controller-manager

Declarative way of managing machines for Kubernetes cluster
Apache License 2.0
257 stars 117 forks source link

Improved context with timeout for DrainNode #920

Closed sssash18 closed 4 months ago

sssash18 commented 5 months ago

What this PR does / why we need it: This PR introduces a drain Context in RunDrain with a timeout so that context cancels and machine can be force deleted later. Which issue(s) this PR fixes: Fixes #785

Special notes for your reviewer:

Release note:

Drain timeout is now correctly honored for Pod eviction during Machine Drain
aaronfern commented 4 months ago

Please add a release note, something like below or feel free to come up with a different one A bug in the drain process where the drain timeout was not respected has been fixed or Timeout based context cancellation will now be followed for machine drains

sssash18 commented 4 months ago

You can change the release note to : "Drain timeout is now correctly honored for Pod eviction during Machine Drain" ?

Can you do a test of this with some short timeouts and Pods with large number of PVs to see if there are no surprises ?

Performed the testing, the context cancellation leads to force delete even if pod with PVs are in process of eviction.