deitch/aws-asg-roller

Option to not force drain a node from kubernetes

gregsidelinger opened this issue · 1 comments

err = drain.Drain(k.clientset, []*corev1.Node{node}, &drain.DrainOptions{
IgnoreDaemonsets: k.ignoreDaemonSets,
GracePeriodSeconds: -1,
Force: true,
DeleteLocalData: k.deleteLocalData,
})

Would it be possible to create an option to not force delete standalone pods? We have a bunch of short term running pods that are not managed by a deployment or job that should be given a chance to finish running. Since there is no backing deployment I can not use a Pod Disruption Budget to instruct kube to not delete them so setting the force=false and trying again later is the only option I can think of.

Certainly. The hardest part about this usually is the user interface, with everything in env vars, but we don't have too many, so it shouldn't be too bad. Maybe ROLLER_PREVENT_DRAIN or similar?

Go for a PR.