You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the ignore_daemonsets option is set to true, the daemonset should not be terminated (this is what happens when using kubectl drain node --ignore-daemonsets --delete-emptydir-data).
ACTUAL RESULTS
The daemonset gets terminated erroneously.
Looking at the code of the module, this is happening because both conditions are evaluated independently. That means any pod with an emptyDir volume will be deleted, regardless of other flags (i.e. even unmanaged pods will be deleted when force is set to false). In my understanding (and seemingly what happens with kubectl), the delete_emptydir_data option should only be applied to filter the list of pods deemed suitable for deletion based on the other criteria.
The text was updated successfully, but these errors were encountered:
SUMMARY
ISSUE TYPE
COMPONENT NAME
kubernetes.core.k8s_drain
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 20.04.5 LTS
Kubernetes 1.27.1
STEPS TO REPRODUCE
emptyDir
volumek8s_drain
module as shown below to drain a node that is running an instance of the daemonsetEXPECTED RESULTS
Since the
ignore_daemonsets
option is set totrue
, the daemonset should not be terminated (this is what happens when usingkubectl drain node --ignore-daemonsets --delete-emptydir-data
).ACTUAL RESULTS
The daemonset gets terminated erroneously.
Looking at the code of the module, this is happening because both conditions are evaluated independently. That means any pod with an
emptyDir
volume will be deleted, regardless of other flags (i.e. even unmanaged pods will be deleted whenforce
is set tofalse
). In my understanding (and seemingly what happens withkubectl
), thedelete_emptydir_data
option should only be applied to filter the list of pods deemed suitable for deletion based on the other criteria.The text was updated successfully, but these errors were encountered: