-
Notifications
You must be signed in to change notification settings - Fork 451
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
[chore] Use informer to track collector Pods in target allocator #2528
[chore] Use informer to track collector Pods in target allocator #2528
Conversation
80c7dc9
to
4fd8431
Compare
// runOnCollectors runs the provided function on the set of collectors from the Store. | ||
func (k *CollectorWatcher) runOnCollectors(store cache.Store, fn func(collectors map[string]*allocation.Collector)) { | ||
collectorMap := map[string]*allocation.Collector{} | ||
objects := store.List() |
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.
to confirm my understanding: calling this store.List will only return all active collector pods right? Anything deleted will not be present?
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.
It will return all existing Collector Pods, not just active ones. Below, we also filter it down to scheduled ones by requiring that NodeName
be present. We do not check for readiness here - I'd like to do that in a follow up. This behaviour is exactly what we currently have.
objects := store.List() | ||
for _, obj := range objects { | ||
pod := obj.(*v1.Pod) | ||
if pod.Spec.NodeName == "" { |
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.
this technically is a functionality change as we will no longer fully restart the watch if this happens, but that's a good thing in my book
…n-telemetry#2528) * Use informer to track collector Pods in target allocator * Rename CollectorWatcher to Watcher
…n-telemetry#2528) * Use informer to track collector Pods in target allocator * Rename CollectorWatcher to Watcher
When do we think a release can be made with this patch? |
@diranged we're waiting on the release from the collector to go through, and then we'll begin our release process. We do have some blocking work in the helm chart, however, that is preventing our 0.99.0 release from going out. You will still be able to use the images though :) |
…n-telemetry#2528) * Use informer to track collector Pods in target allocator * Rename CollectorWatcher to Watcher
Use an informer for tracking collector Pods in the target allocator, instead of the custom active watcher we've had till now. This is just to make things more standardized and maintainable. I've also implemented a rate limiter on collector updates while at it.
This will make it easier to fix #2201 in a follow-up.
Most likely fixes #2916.