Skip to content
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

Known object count quota problems with uninitialized objects #53109

Closed
caesarxuchao opened this issue Sep 27, 2017 · 9 comments
Closed

Known object count quota problems with uninitialized objects #53109

caesarxuchao opened this issue Sep 27, 2017 · 9 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. milestone/removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@caesarxuchao
Copy link
Member

Background: when is quota charged

The object count quota is charged when an object is created, no matter if it's initialized or uninitialized. This is to protect the system from having too many uninitialized objects.

Other quotas are charged when objects are initialized. They don't suffer from the problems.

Problems with replenishing the object count quota

  • if the object is deleted uninitialized, the object count quota is not replenished immediately, because the quota replenishment controller doesn't observe uninitialized objects.
  • the resource quota controller does a full resync every 5mins. It lists every objects in the informer and recalculate the quota usage. The informer doesn't include uninitialized objects, so the controller will wrongly replenish the object count quota for uninitialized objects.

Brain storming fixes

  • Let the replenishment controller observe the uninitialized objects (e.g., Add options to sharedinformers to include uninitialized objects #51247).

  • Or, for the replenishment of object counts, we build a special informer that only observes uninitialized objects. Assuming that the number of uninitialized objects is small, storing uninitialized objects outside of the shared informer causes small overhead.

    • We can add an fieldSelector or accept header to let apiserver only return uninitialized objects for list/watch.
    • Further, we can create a separate quota for uninitialized object counts.

Related issues

#51820 notes multiple problems with the quota system. Fixing them all-at-once requires a redesign, which could cost multiple quarters. I want to graduate initializers to beta independent of #51820, so I filed this issue to discuss more targeted solutions.

@kubernetes/sig-api-machinery-bugs @lavalamp @liggitt @derekwaynecarr

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. kind/bug Categorizes issue or PR as related to a bug. labels Sep 27, 2017
@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Sep 27, 2017
@caesarxuchao caesarxuchao self-assigned this Sep 27, 2017
@caesarxuchao
Copy link
Member Author

/sig api-machinery

@caesarxuchao caesarxuchao added this to the v1.9 milestone Sep 27, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Sep 27, 2017
@dixudx
Copy link
Member

dixudx commented Sep 27, 2017

Or, for the replenishment of object counts, we build a special informer that only observes uninitialized objects. Assuming that the number of uninitialized objects is small, storing uninitialized objects outside of the shared informer causes small overhead.

  • We can add an fieldSelector or accept header to let apiserver only return uninitialized objects for list/watch.
  • Further, we can create a separate quota for uninitialized object counts.

+1. Agree. With fieldSelector, this will be quite concise. Currently, metadata.initializers is not supported yet. We may need to add it.

@caesarxuchao caesarxuchao added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Oct 5, 2017
@k8s-github-robot
Copy link

[MILESTONENOTIFIER] Milestone Removed

@caesarxuchao @kubernetes/sig-api-machinery-bugs

Important: This issue was missing the status/approved-for-milestone label for more than 7 days.

Help

@fejta-bot
Copy link

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.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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 Jan 11, 2018
@munnerz
Copy link
Member

munnerz commented Jan 25, 2018

FYI, as of #54660 it is now possible to tweak the ListOptions used by a SharedInformerFactory in order to watch uninitialized objects. This would be a factory-wide tweak however, meaning all controllers in kube-controller-manager would need to handle uninitialized objects cleanly.

@fejta-bot
Copy link

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
/remove-lifecycle stale

@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 Feb 24, 2018
@nikhita
Copy link
Member

nikhita commented Mar 1, 2018

/remove-lifecycle rotten
/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Mar 1, 2018
@liggitt
Copy link
Member

liggitt commented Jan 25, 2019

the alpha initializers feature has been removed in 1.14

/close

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closing this issue.

In response to this:

the alpha initializers feature has been removed in 1.14

/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
kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. milestone/removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

8 participants