Skip to content

quota: allow ignored resources to be customized #64310

Closed
nikhita wants to merge 2 commits intokubernetes:masterfrom
nikhita:quota-customize-ignored-resources
Closed

quota: allow ignored resources to be customized #64310
nikhita wants to merge 2 commits intokubernetes:masterfrom
nikhita:quota-customize-ignored-resources

Conversation

@nikhita
Copy link
Copy Markdown
Member

@nikhita nikhita commented May 25, 2018

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:

Resources to be ignored by the resource quota controller can now be customized.

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 25, 2018
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 25, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 25, 2018
@k8s-github-robot k8s-github-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label May 25, 2018
@nikhita
Copy link
Copy Markdown
Member Author

nikhita commented May 25, 2018

The changes relevant to this PR are in e0a4384.

@nikhita nikhita force-pushed the quota-customize-ignored-resources branch from 2ccd7f0 to c5bc701 Compare May 25, 2018 13:02
@nikhita
Copy link
Copy Markdown
Member Author

nikhita commented May 25, 2018

/cc @ncdc

since you did the GC one (#45897)

@k8s-ci-robot k8s-ci-robot requested a review from ncdc May 25, 2018 13:09
@nikhita nikhita force-pushed the quota-customize-ignored-resources branch 2 times, most recently from 2ef5578 to 5e3122d Compare May 25, 2018 13:31
type ResourceQuotaControllerOptions struct {
ResourceQuotaSyncPeriod metav1.Duration
ConcurrentResourceQuotaSyncs int32
RQIgnoredResources []componentconfig.GroupResource
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the RQ prefix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the RQ prefix?

IMO no. I named it that way for consistency:

  • The sync period is called ResourceQuotaSyncPeriod and not just SyncPeriod.
  • 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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower case errors


s.GarbageCollectorController.GCIgnoredResources = gcIgnoredResources

rqIgnoredResources := make([]componentconfig.GroupResource, 0, len(quotainstall.DefaultIgnoredResources()))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assign quotainstall.DefaultIgnoredResources() to a var. Calling it twice looks fishy.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also rebased on top of master.

@deads2k
Copy link
Copy Markdown
Contributor

deads2k commented May 25, 2018

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.

@nikhita
Copy link
Copy Markdown
Member Author

nikhita commented May 25, 2018

I think this is highlighting the need to have a dynamic shared informer factory.

Makes sense. I'll create an issue for it.

@nikhita
Copy link
Copy Markdown
Member Author

nikhita commented May 25, 2018

I'll create an issue for it.

Created #64319

@nikhita
Copy link
Copy Markdown
Member Author

nikhita commented May 26, 2018

@deads2k @sttts can we still get the customization of ignored resources in for 1.11? It is independent from that of supporting custom resources.

@nikhita nikhita force-pushed the quota-customize-ignored-resources branch from 5e3122d to 14a575e Compare May 26, 2018 18:27
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 26, 2018
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nikhita
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers: deads2k, mtaufen

Assign the PR to them by writing /assign @deads2k @mtaufen in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nikhita nikhita force-pushed the quota-customize-ignored-resources branch from 14a575e to 4558a47 Compare May 26, 2018 18:36
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.
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

k8s-ci-robot commented May 26, 2018

@nikhita: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-device-plugin-gpu 4558a47 link /test pull-kubernetes-e2e-gce-device-plugin-gpu

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.

Details

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. I understand the commands that are listed here.

@nikhita
Copy link
Copy Markdown
Member Author

nikhita commented May 31, 2018

@sttts @deads2k what do you think about this + making sure that GetQuotableResources does not return an error (#59826 (comment)) for 1.11?

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@nikhita: PR needs rebase.

Details

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2018
@liqlin2015
Copy link
Copy Markdown

@nikhita
Copy link
Copy Markdown
Member Author

nikhita commented Aug 10, 2018

@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 GetDeletableResources work for GC:

// All discovery errors are considered temporary. Upon encountering any error,
// GetDeletableResources will log and return any discovered resources it was
// able to process (which may be none).
func GetDeletableResources(discoveryClient discovery.ServerResourcesInterface) map[schema.GroupVersionResource]struct{} {

#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.

@ncdc
Copy link
Copy Markdown
Member

ncdc commented Aug 17, 2018

/uncc

@k8s-ci-robot k8s-ci-robot removed the request for review from ncdc August 17, 2018 13:37
@fejta-bot
Copy link
Copy Markdown

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 15, 2018
@fejta-bot
Copy link
Copy Markdown

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 15, 2018
@fejta-bot
Copy link
Copy Markdown

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@fejta-bot: Closed this PR.

Details

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants