keikoproj / lifecycle-manager

Graceful AWS scaling event on Kubernetes using lifecycle hooks
Apache License 2.0
94 stars 28 forks source link

add flag to make the deregister target type configurable #212

Open ZihanJiang96 opened 1 month ago

ZihanJiang96 commented 1 month ago

Is this a BUG REPORT or FEATURE REQUEST?:

FEATURE REQUEST

What happened:

In lifecycle-manager during node termination with --with-deregister flag, we always check both ClassicELB and TargetGroup to deregister the node from load-balancer we will make many Describe calls on TargetGroup.

This is a valid use-case if we are using ec2 nodes as the Load-balancer targets. But if we are using flat network, the TargetGroup is managed by the ALB ingress controller, in this case, we don't need to describe TargetGroup to deregister the node.

What you expected to happen:

https://github.com/keikoproj/lifecycle-manager/blob/master/pkg/service/server.go#L306-L335

It is better to introduce a new flag like --deregister-target-type which can take comma-separated values like ClassicELB and TargetGroup