-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Implement adding priority to ResourceQuota #48648
Comments
Talked with bsalamat offline, will /assign resouer |
A high level idea of how priority should be added to ResourceQuota is to add a field to resource quota that specifies a priority class name. When the field is set, it indicates that the quota applies to that priority class. If the field is not present, quota applies to all priority classes. |
Yes, that sounds reasonable. Here are a few other observations (in the below points, "exists" means "exists in the same namespace")
One last comment: I wonder if we should have some way to say "this ResourceQuota should be associated with the current default PriorityClass." We can't use "PriorityClass field not present" to mean this since we're already using that to mean something else in the approach @bsalamat described above. I guess we could use "PriorityClass present but empty" to mean "whatever the current default PriorityClass is"... |
@davidopp I think we should use a ResourceQuota with no PriorityClass to mean default quota for all pods and then we should allow another ResourceQuota to co-exist in that namespace that specifies quota for a particular priority.
In the above example, quota for pods except those created with "critical" priority is 10GB of memory and quota for those created with "critical" priority is 1GB. |
I think if we're going to allow the kind of thing you described, it is simpler to say the non-priority quota applies to everything. In other words, in your example the sum of resources across all pods in the namespace cannot exceed 10GB, and the sum of resources across critical pods in the namespace cannot exceed 1GB. But I actually don't think we should allow a namespace to have both kinds of quota. I think there are probably only two common use cases: the "legacy" use case where the users of the cluster are not going to use the priority feature, and the use case where priority is used. Allowing a non-priority quota in a namespace is needed for the first case, but it seems harmful in the second case, since it gives the namespace some amount of quota at the highest priority. So I don't really see people using both of these together, unless there's something I'm not thinking of. |
Yes, I agree.
In the second case, how should one give a large quota to all priorities, but give a small quota to high priority pods? If we don't support co-existence of quota with no priority and quota with priority, then cluster admin has to create one ResourceQuota for each PriorityClass in each namespace. They must also add new ResourceQuota everytime a new PriorityClass is added. |
Yes, this is what I had in mind. But I don't think this is so bad, as cluster admins are unlikely to add new PriorityClasses often. I imagine the workflow they want is to create the new PriorityClass, then give people access to it. In the approach you described, everyone with a non-priority quota would immediately get access to a new PriorityClass, unless the admin added a quota for the new PriorityClass before adding the PriorityClass, which would mean we would have to allow quotas that name non-existant PriorityClasses. We do need a better way to do default creation of objects in namespaces (in this case a ResourceQuota), via addon manager or upstreaming OpenShift project templates or something like that. But we need that for other reasons anyway. |
That's a fair point. It is worth noting that this will work when absence of quota means "no quota". I think we already have ways to set this quota policy. So, your design looks fine to me. |
I also agree with davidopp@'s design; it cover all user cases in my mind. And --
This's a kind of hierarchical quota to me; prefer to handle it in kubernetes/enhancements#269 or incubator proj for it. In priority/preemption project, flat Quota is better. |
Thanks for enlightening, also, personally vote for keep design simple in early phase. Will send out PR next week. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle stale |
/assign |
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. |
/remove-lifecycle stale |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Introduce priority class in the resource quota **What this PR does / why we need it**: Implements kubernetes/community#933 **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #48648 **Special notes for your reviewer**: Test Cases are still to be covered. Opening this PR to make discussion convenient with code references. Will update test cases only after design PR has got merged. **Release note**: ```release-note Ability to quota resources by priority ``` /kind feature /priority important-soon /sig scheduling /sig node /cc @resouer @derekwaynecarr @sjenning @bsalamat @timstclair @aveshagarwal @ravisantoshgudimetla
@vikaschoudhary16 Could you please update the ResourceQuota documentation with the addition of pod priority? |
Is this a BUG REPORT or FEATURE REQUEST?: Feature request
@kubernetes/sig-scheduling-feature-requests
ref/ #47604
The text was updated successfully, but these errors were encountered: