-
Notifications
You must be signed in to change notification settings - Fork 4
Elaa's solution #1
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
base: main
Are you sure you want to change the base?
Conversation
| 1. What are the event types that the reconciler can recieve: Controller Request | ||
|
|
||
| 1. Which controller option controls how often Level-based reconciliation occurs? | ||
| 1. Which controller option controls how often Level-based reconciliation occurs: Resync after |
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.
Take a look at this article https://www.redhat.com/en/blog/kubernetes-operators-best-practices#:~:text=Deriving%20from%20electronic%20circuit%20design,reacting%20to%20a%20state%20variation.
So level based reconciliation happens periodically, without an event occurring. Can you find the option for this?
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.
In older versions of controller runtime there was a resync option while creating a manager it used to be directly accessible through ctrl.Options but now it has to be done through the cache option and I used it in my kubebuilder implementation. During the creation of the manager I added the following option: Cache: cache.Options{
SyncPeriod: &syncPeriod}
| 1. What is the difference between the `builder.Builder`'s `For`, `Owns` and `Watches` methods: For is for which resource kind is used i.e MyApps, Owns: the MyApp will own the CRs instances, | ||
|
|
||
| 1. What happens if 10 updates to the same object occur in rapid succession (ie: before a single Reconcile occurs)? How many times is Reconcile called, and with which version of the object? | ||
| 1. What happens if 10 updates to the same object occur in rapid succession (ie: before a single Reconcile occurs)? How many times is Reconcile called, and with which version of the object?: The events will be added to the reconciliation queue and will be handled in order for the atest version of the object |
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.
Is that correct? That it will send 10 updates all with the newest version?
I actually forget the answer here so just double checking. I thought it coalesced into a single event with the latest update.
If you want help recreating this scenario we can do it :)
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.
Maybe it does coalesce into a single event. I know if some of the updates include similar changes let's say 6 update change the number of replicas of the same deployment for example, the controller will go with the latest change to the number of replicas but if the remaining 4 updates include different changes they would also be included. So maybe all the updates and merged into one to reach the latest desired state. I would love to recreate it
README.md
Outdated
| 1. What happens if 10 updates to the same object occur in rapid succession (ie: before a single Reconcile occurs)? How many times is Reconcile called, and with which version of the object?: The events will be added to the reconciliation queue and will be handled in order for the atest version of the object | ||
|
|
||
| 1. How can you control the speed of reconciliation? | ||
| 1. How can you control the speed of reconciliation: Requeue after |
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.
Requeue after, is a retry mechanism. So it does not control the speed of reconciliation across multiple objects. Take a look at some of the options when instantiating the controller
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.
there is the RateLimiter option for the controller but it is used to slow down the retries in case of frequent failures. There is also SyncPeriod option
| 1. If a single resource is in a failed state, does it block reconciliation of other objects? No | ||
|
|
||
| 1. A ReconcileRequest only has the `NamespacedName`. How do you get the full object? Is this object cached, or result in an API call to the k8s master? | ||
| 1. A ReconcileRequest only has the `NamespacedName`. How do you get the full object? Is this object cached, or result in an API call to the k8s master?API call |
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.
or from the cache, which maintains the state of the most recent data.
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.
Since I added the cache option to my manager declaration I thought it wasn't enabled by default but I guess it is
steeling
left a comment
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.
great work! I really like that you codified a lot of the scenarios :)
If you think there's anything that would benefit people taking the exercise in the future (without giving away answers), let's create a separate PR and add that content :)
No description provided.