chore: add annotations to events in SQS mode #715
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes:
This PR enriches Kubernetes events when running in SQS mode by adding annotations to such events, so they can later be used to get information about the node involved in the event, create filters, etc. Similar to what was done in #411
I have decided to add almost the same annotations the events in IMDS mode have, but I'd like some thoughts here because most of the information is gathered from node labels so we could simply attach all node labels as tags instead, or even do the two approaches simultaneously.
The only annotation I'm not adding here is
instance-life-cycle
because that's something that can be easily obtained from the IMDS endpoint but it's not present in the KubernetesNode
object, so it would have to be fetched from the AWS API instead (doable of course, but at the cost of another AWS API call). Again, I don't have a strong opinion on either option so thoughts welcome.I intend to add a unit test (similar to
test/e2e/spot-interruption-test-events-on
once the set of annotations the events will have is decided.Also, I will submit another PR to update the documentation once this PR and also #703 and #706 land. At New Relic we are running an image containing the changes in all 3 PRs combined and it works great.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.