foriequal0/pod-graceful-drain

Finalizer support

Closed this issue · 2 comments

I'm trying to understand why you made use of admission webhooks instead of finalizers.

With finalizers we wouldn't have to artifically delay anything and could just re-queue the terminating pod to be checked again. Pods would get into "Terminating" state, the load balancer (e.g. aws-alb-load-balancer-controller) would handle removing the pod from the target group and as soon as the pods' ip isn't registered in the LB anymore we could release the finalizer.

Just asking myself whether that's something we could contribute.

I've tried finalizers! Finalizers prevent "Pod"s from being removed, but they don't prevent "Container"s from being "Terminated".

Good catch. Didn't think of that! You're absolutely right that finalizers only prevent the deletion of the raw objects kubernetes/kubernetes#73584 too Bad. Thanks for your input!