quota: allow ignored resources to be customized #64310
quota: allow ignored resources to be customized #64310nikhita wants to merge 2 commits intokubernetes:masterfrom
Conversation
|
The changes relevant to this PR are in e0a4384. |
2ccd7f0 to
c5bc701
Compare
2ef5578 to
5e3122d
Compare
| type ResourceQuotaControllerOptions struct { | ||
| ResourceQuotaSyncPeriod metav1.Duration | ||
| ConcurrentResourceQuotaSyncs int32 | ||
| RQIgnoredResources []componentconfig.GroupResource |
There was a problem hiding this comment.
Do we need the RQ prefix?
IMO no. I named it that way for consistency:
- The sync period is called
ResourceQuotaSyncPeriodand not justSyncPeriod. - The ignored resources for GC are also called
GCIgnoredResources.
I guess we can change the above and remove the RQ prefix. Wdyt?
| // Periodically the quota controller to detect new resource types | ||
| go resourceQuotaController.Sync(discoveryFunc, 30*time.Second, ctx.Stop) | ||
| // Periodically sync the quota controller to detect new resource types | ||
| go resourceQuotaController.Sync(resourceQuotaControllerClient.Discovery(), 30*time.Second, ctx.Stop) |
There was a problem hiding this comment.
is this intentional that resourceQuotaControllerClient.Discovery() is only executed once?
| resourceQuotaController, err := resourcequotacontroller.NewResourceQuotaController(resourceQuotaControllerOptions) | ||
| if err != nil { | ||
| return false, err | ||
| return true, fmt.Errorf("Failed to start the resource quota controller: %v", err) |
|
|
||
| s.GarbageCollectorController.GCIgnoredResources = gcIgnoredResources | ||
|
|
||
| rqIgnoredResources := make([]componentconfig.GroupResource, 0, len(quotainstall.DefaultIgnoredResources())) |
There was a problem hiding this comment.
assign quotainstall.DefaultIgnoredResources() to a var. Calling it twice looks fishy.
There was a problem hiding this comment.
Done. Also rebased on top of master.
|
I think this is highlighting the need to have a dynamic shared informer factory. If I've reading this code correctly, we've just doubled the number of times we're caching resources and not created the capital to make this easy in general. With a dynamic shared informer factory, it becomes possible wire the "get informer for resource" to delegate across multiple candidates as we do in openshift. All that helps the general cause and avoids unnecessary duplication. I think the feature can wait until 1.12 so the proper infrastructure can be developed. |
Makes sense. I'll create an issue for it. |
Created #64319 |
5e3122d to
14a575e
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nikhita Assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
14a575e to
4558a47
Compare
Allow the list of resources the resource quota controller should ignore to be customizable, so downstream integrators can add their own resources to the list, if necessary.
|
@nikhita: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
|
@sttts @deads2k what do you think about this + making sure that |
|
@nikhita: PR needs rebase. 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/test-infra repository. |
|
@nikhita Is there any impact we just log error but not return error here https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/resourcequota/resource_quota_controller.go#L167 |
@liqlin2015 If we return the error here, the controller manager can crash. :) This function here is modelled similar to how kubernetes/pkg/controller/garbagecollector/garbagecollector.go Lines 640 to 643 in ecc64f2 #55022 (issue) outlines the problems caused if we returned an error here. #55259 (PR) changed the GC to tolerate partial discovery errors to fix this issue. |
|
/uncc |
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
|
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
|
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
|
@fejta-bot: Closed this PR. DetailsIn response to this:
Instructions 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/test-infra repository. |
Allows the list of resources the resource quota controller should ignore to be customizable, so downstream integrators can add their own resources to the list, if necessary.
Fixes #64201 (comment)
Builds on top of #64201
/cc sttts deads2k derekwaynecarr
/assign deads2k
Release note: