Split CapacityQuota usage and validation reconcilers#9800
Conversation
|
This issue is currently awaiting triage. If SIG Autoscaling contributors determines this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: norbertcyran The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
CapacityQuota controller right now does two steps: validating the quota and calculating usages. Calculating usages is a way more complex task, since it iterates over all nodes in the cluster, while validation only validates the spec of a single CapacityQuota. Those steps also have different triggers - validation should run on every update of CapacityQuota, even a status update in case of manual updating the status by the user. Because of that, the validation reconciler will always run twice in a row, which we definitely want to avoid in case of the usage calculation. Usage reconciler needs to watch Nodes and CapacityQuota spec changes, but it does not need to watch CapacityQuota status changes. Another benefit of splitting the controllers is the fact that they will have separate queues, so the validation can keep running even if the usage reconciler queue is overloaded.
885f82a to
40acb4a
Compare
|
/assign x13n |
rrangith
left a comment
There was a problem hiding this comment.
/lgtm
one small nit, otherwise looks good!
| } | ||
| } | ||
|
|
||
| // Reconcile reconciles CapacityQuota's current usage.. |
There was a problem hiding this comment.
| // Reconcile reconciles CapacityQuota's current usage.. | |
| // Reconcile reconciles CapacityQuota's current usage. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
CapacityQuota controller right now does two steps: validating the quota and calculating usages. Calculating usages is a way more complex task, since it iterates over all nodes in the cluster, while validation only validates the spec of a single CapacityQuota. Those steps also have different triggers - validation should run on every update of CapacityQuota, even a status update in case of manual updating the status by the user. Because of that, the validation reconciler will always run twice in a row, which we definitely want to avoid in case of the usage calculation. Usage reconciler needs to watch Nodes and CapacityQuota spec changes, but it does not need to watch CapacityQuota status changes. Another benefit of splitting the controllers is the fact that they will have separate queues, so the validation can keep running even if the usage reconciler queue is overloaded.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: