aws / aws-node-termination-handler

Gracefully handle EC2 instance shutdown within Kubernetes
https://aws.amazon.com/ec2
Apache License 2.0
1.62k stars 263 forks source link

imds asg target lifecycle hook #837

Closed pete911 closed 1 day ago

pete911 commented 1 year ago

Describe the feature Target lifecycle state is available through instance metadata since March 2022 - https://docs.aws.amazon.com/autoscaling/ec2/userguide/retrieving-target-lifecycle-state-through-imds.html It would be nice to enable this on aws-node-termination-handler when deployed in imds mode.

Is the feature request related to a problem? Even though ASG Termination lifecycle hook is available in Queue processor mode, for some cases this adds additional infrastructure complexity (SQS, private link to SQS, permissions etc.), it would be nice to add this in IMDS mode as well, since it is available.

Initial pull request (tested in EKS cluster as well) is here https://github.com/aws/aws-node-termination-handler/pull/825

pete911 commented 1 year ago

@cjerad is this something you would like to merge? I removed staled label from the PR twice, but it has now been closed.

pete911 commented 10 months ago

Hi @jillmon, @cjerad any news on this?

LikithaVemulapalli commented 1 month ago

Hello @pete911, apologies for late response. I saw your PR and we feel including the Lifecycle hooks in IMDS mode will be very useful feature. If possible could you work on the e2e tests as this is a major feature request we would also like some e2e tests to ensure the work flow is not broken and is working as expected. The setup on how we will include LifeCycle Hooks in IMDS in README section will be very helpful for others who want to use this feature. Please let us know if you are still interested working on this feature. Thanks :)

pete911 commented 1 month ago

Hi @LikithaVemulapalli, PR has been opened for more than a year (that was the time we wanted to use node termination handler), I asked multiple times @jillmon and @cjerad that were assigned to this PR, but I got no response from them. I currently do not work with EKS/kubernetes and do not use node termination handler. PR should contain everything needed, it has been tested at that time in EKS cluster, but unfortunately I won't have time to add e2e test.

LikithaVemulapalli commented 1 month ago

Hello @pete911, thanks for the response, we will take forward from here. Thanks for your contribution, appreciate it :)