-
Notifications
You must be signed in to change notification settings - Fork 7
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
Addition events for pre-existing resources #15
Comments
I believe (if I remember right!) that you want to test if the For various reasons you don't want to be too reliant on the presence of The analogous Go code refers to this state as cache sync. I seem to recall I actually fire a Java beans property when this happens, but it's unclear exactly how you'd make use of that here, to be fair. |
Thank you for the answer, checking for When you say
is the preferred pattern to just poll the cache entries periodically? If the presence of Just discovered |
(Bear in mind the Go code is the authoritative answer; I've just tried to translate it into Java idiomatically.) Remember that if you set up a synchronization interval, then every so often the cache gets repopulated in its entirety via a list operation. I think the salient point here is when an event comes in, you don't just grab the data from the event, but you ask the cache for the relevant data. Regarding |
I was dealing with this by checking timestamps, but using the |
Might be cool to get events posted when the timed synchronization has happened too? |
For background on the patterns involved here, have a look at this: https://stackoverflow.com/questions/31041766/what-does-edge-based-and-level-based-mean So Kubernetes in general is biased towards level-based. That is, rather than relying on the reception of an event (in general), Kubernetes internals always check the "level" of the system to verify if it matches what any given event or stopwatch expiration might claim it is supposed to be. I am sure there is more work to do in this area in my framework. For example, one of the things I'd like to do in the abstract is to tell the event broadcasting mechanism to not fire at all until |
Thanks for writing this and the accompanying 11-part blog post! I'm new to kubernetes so this was a good primer.
I was confused by addition events I got upon starting up a test controller for pods that already existed prior to the controller being started. From the code it looks like that's expected? If so, what would be the canonical way to properly ignore/filter those out in an event consumer? I spent some time to see if there's a way to provide a non-empty known objects map but I don't think that's what you've intended here right?
Here's my messy throwaway code
and I get output like the following when calling start
Does there need to be a way to get a controller "up to speed" with the state of the world before it starts processing net-new events as deltas upon that state?
The text was updated successfully, but these errors were encountered: