Skip to content

Conversation

@Elaa-jamazi
Copy link

No description provided.

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
Copy link
Owner

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?

Copy link
Author

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
Copy link
Owner

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 :)

Copy link
Author

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
Copy link
Owner

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

Copy link
Author

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
Copy link
Owner

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.

Copy link
Author

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

Copy link
Owner

@steeling steeling left a 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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants