Optimize LCH Behavior During Termination Events #1926
Labels
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
maintenance
Code/Project quality related
Issue Description
Currently, the CSI node pod utilizes OS graceful shutdown time during termination events by waiting for volumes on a node to be detached because Kubelet's node shutdown manager does not consider volume cleanup as a signal and tends to prematurely terminate the driver pod, which can result in delayed attachments.
Ideally,
DetachVolume
calls should complete beforeTerminateInstances
is invoked - however, in scenarios whereTerminateInstances
is called by autoscalers such as Karpenter, it is undesirable for the lifecycle hook to wait for detachments to succeed in the backend becauseDetachVolume
requests made afterTerminateInstances
will wait for theTerminateInstances
workflow to complete.Additional Context
According to the external attacher docs, checking for the presence of
DeletionTimestamp
in VA objects can be used to ensure that volumes have been successfully unmounted from k8s perspective (which is more reliable than scanning for mounts on the host).Also, kubelet sets a
NotReady
condition on the node with the reason set to "node is shutting down", which can be used to determine node status to stop waiting on detaches in specifically the scenario described above.The text was updated successfully, but these errors were encountered: