-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add replicaset and job metaGenerator based on watcher #44
Conversation
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
@MichaelKatsoulis @gizas this one is ready for review when you have the time :) |
Very nice work! |
meta := p.job.GenerateFromName(po.Namespace + "/" + jobName) | ||
cronjobName, _ := meta.GetValue("cronjob.name") | ||
if cronjobName != "" { | ||
_, _ = out.Put("cronjob.name", cronjobName) |
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.
Wondering if we can put a debug message here on every put action.
And then for cases that we want to troubleshoot OOM issues we can enable debug and check what put actions might take place.
@ChrsMark would it be valuable?
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.
That's a valid point on high level, however I don't think a debug
message at this place would actually help us. Here we just retrieve an already stored value and also this message would occur many times for big number of Pods so this would be an overkill. Sth helpful would be to check the size of the local caches (Informers' cache) but this is quite out of scope I think on this PR. In any case have created elastic/beats#35591 to evaluate further improvements.
Part of #31 to solve increased memory usage of
add_resource_metadata.deployment
andadd_resource_metadata.cronjob
based on what was described at #31.The library "interface" that changes is the
elastic-agent-autodiscover/kubernetes/metadata/metadata.go
Lines 91 to 96 in f4ec42c
GetPodMetaGen
requires the 2 additional watchers.We need to adopt accordingly Beats and Agent parts so as to use the new version of the library properly:
Note: I'm planning to add new tests for the 2 additional MetaGenerators in this PR however review can already start in the main codebase's changes.
Screenshots
The following screenshots indicate that the memory leak does not occur with this implementation as well as that the fields are populated properly.