Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ASGLifecycle showing up as UnknownInterruption on K8 events (#1024) #1096

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

hyeong01
Copy link
Contributor

@hyeong01 hyeong01 commented Dec 5, 2024

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
reproduce issue 1024 - ASGCycle
Reproducing the issue for StateChange appearing as unknownInterruption
reproduce issue 1024 - State Change
Fixing the issue for ASGLifeCycle appearing as unknownInterruption
fix issue 1024 - ASGLifeCycle
Fixing the issue for StateChange appearing as unknownInterruption
fix issue 1024 - state change

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

@hyeong01 hyeong01 requested a review from a team as a code owner December 5, 2024 22:23
@Lu-David
Copy link
Contributor

Lu-David commented Dec 5, 2024

Can you briefly add description on how you tested it? Include any screenshots with non-sensitive information would be helpful. I will also update the template to have a testing section.

@hyeong01
Copy link
Contributor Author

hyeong01 commented Dec 5, 2024

Hi David, what do you think about also tapping on a related issue? StateChange event is appearing as UnknownInterruption as well. This can be fixed by adding one more case loop for StateChangeKind. Seems like a good time to fix and test it together. Attached is the k8 events log that emits UnknownInterruption instead of StateChange.

Screenshot 2024-12-05 at 3 23 58 PM

@Lu-David
Copy link
Contributor

Lu-David commented Dec 5, 2024

Good catch, we should fix that as well. Thanks!

@hyeong01 hyeong01 merged commit 9517b9d into aws:main Dec 6, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants