-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[k8sprocessor] Add ability to associate metadata tags using pod UID rather than just IP #2199
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
[k8sprocessor] Add ability to associate metadata tags using pod UID rather than just IP #2199
Conversation
d90e3af
to
44c8f1e
Compare
Codecov Report
@@ Coverage Diff @@
## main #2199 +/- ##
=======================================
Coverage 90.45% 90.46%
=======================================
Files 397 397
Lines 19563 19614 +51
=======================================
+ Hits 17695 17743 +48
- Misses 1406 1408 +2
- Partials 462 463 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
… rather than just IP Signed-off-by: Patryk Matyjasek <[email protected]>
44c8f1e
to
9725609
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really nice!
return | ||
} | ||
} | ||
c.Pods[pod.Status.PodIP] = newPod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I get it right that the same pod will exist twice in the list, once keyed by the IP and once by the ID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually discussed this with @pmatyjasek-sumo while he was working on the extension :) Having a single map and two references to the pod just makes the things easier, since this are different domains that have no risk of conflicts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpkrohling as @pmm-sumo mentioned we had some discussion on that and we decided that it should be ok if 2 keys from map will point to the same reference. With this we avoid to use two loops to iterate through two lists of Pods (one by IP and second by UID)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's fine, but you might want to add the current size of this map in a metric somewhere: this is the kind of data that can easily explode in terms of number of elements. It's not unusual to have tens of thousands of pods in a given cluster, so, having this info would help people running the processor to identify any possible memory issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this done? If you don't to do it in this PR, create an issue to track this.
Co-authored-by: Juraci Paixão Kröhling <
Description:
Add ability to associate metadata tags in k8s processor using pod UID rather than just IP
Link to tracking Issue: #1146
Testing:
Unit tests
Documentation:
In-code comments