Fix ASGLifecycle showing up as UnknownInterruption on K8 events (#1024) by hyeong01 · Pull Request #1096 · aws/aws-node-termination-handler
Issue #, if available:
#1024
Description of changes:
getReasonForKindV1 used for K8sEventsRecorder was not catching ASGLifeCycle and StateChange events, making the event fall to the default case of unknownInterruption. Added new case loops that catch ASGLifeCycle and StateChange event.
Testing methodology
Reproduced the issue #1024 via Queue processor mode. First, created EKS Cluster associated with Auto Scaling Group (ASG). Manually edited and decreased the capacity of ASG to shut down EC2 instances and trigger ASGLifeCycle and StateChange events.
Made code fixes and tested the change by building a docker image and deploying that NTH version via AWS Elastic Container Registry (ECR) with helm. Test output can be seen below.
Test Output
Reproducing the issue for ASGLifeCycle appearing as unknownInterruption

Reproducing the issue for StateChange appearing as unknownInterruption

Fixing the issue for ASGLifeCycle appearing as unknownInterruption

Fixing the issue for StateChange appearing as unknownInterruption

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.