-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
First-start reconcilation loop #30
Comments
This sounds like a good option if the function is defined by a user, the Watcher can start a timer to call it periodically. Re: the beginning of time, I was planning to bump a minor version when I migrate to k8s library. When doing this I was also going to change the default from beginning of time to the “current” revision stamp. |
Regarding the very last point, I'm not certain based on the phrasing, but I think it might be counter to the goal I was expressing with this issue. In short, when my operator starts up, I want an opportunity to examine all existing CRDs that my operator is interested in, ideally without firing an extra request to fetch this history. The very first request the library performs upon launch already includes the information I'm after, it's just discarded after the latest resource version is parsed rather than passed on anywhere else. |
Ahhh! I gotcha. Yes that would be a cool!
Thanks,
Cory O’Daniel
… On Mar 6, 2019, at 8:42 AM, Shane Sveller ***@***.***> wrote:
Regarding the very last point, I'm not certain based on the phrasing, but I think it might be counter to the goal I was expressing with this issue. In short, when my operator starts up, I want an opportunity to examine all existing CRDs that my operator is interested in, ideally without firing an extra request to fetch this history. The very first request the library performs upon launch already includes the information I'm after, it's just discarded after the latest resource version is parsed rather than passed on anywhere else.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
* [Added] support for a `reconcile/1` callback.Added support for a `reconcile/1` callback. * [ADDED] `reconcile_every` config option to schedule how often to run reconciliation * [ADDED] `reconcile_batch_size` to set the size of the HTTP GET limit when fetching batches of items to reconcile * [FIXED] receiving `:DOWN` messages no longer crashes Watcher #20 * [FIXED] issue with partially received events #43 Closes #43 Closes #20 Closes #30
Disclaimer: Code links are merely for my own reference and other less-familiar readers, and are by no means meant to imply that the maintainer does not know the contents of their own codebase. 😄
Environment
Current behavior
The current
Bonny.Controller
behaviour defines theadd
,modify
anddelete
callbacks and includes these three events in themix bonny.gen.controller
templating.Expected behavior
I would like to propose an additional callback of
reconcile
(or another representative terminology) that will, during the first boot cycle and again periodically on a configurable timer, examine existing CRDs within the operator's purview. Then it will ensure that any appropriate action has been taken based on their contents, i.e. that managed descendent resources exist with the desired content. With an eye for as much idempotency as possible, it should correct any configuration drift that may have happened while a Bonny-based operator was offline, misbehaving, etc.This is a common practice in other operator codebases and frameworks, and would help enable the declarative, convergent behavior that we've come to appreciate from standard Kubernetes primitives.
Other notes
The current
Bonny.Watcher
implementation short-circuits the review of existing resources that match thewatch
request within theBonny.Watcher.Impl
module, which on the first request without a resource version:This feature probably also depends on #27 for clean access to the
/status
subresource to make it truly graceful to handle pre-existing CRDs which have already been realized.Finally, I have half-formed ideas of trying this on my own project that may result in a PR here for discussion purposes, but I'm not yet using this library at work and will have difficulty committing the time soon.
The text was updated successfully, but these errors were encountered: