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

proposal: min-excess control for quota #2289

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TaoYang526
Copy link
Contributor

@TaoYang526 TaoYang526 commented Dec 5, 2024

Ⅰ. Describe what this PR does

We have leveraged multi-level quotas capability of elastic-quota to manage products and their tenants in our cluster, there is a requirement to support a mixed payment type for some products: tenants can reserve specified resource they want, meanwhile they are allowed to use more resource on demand, both reserved and on-demand resource need to be limited on the product and tenant levels. For example, tenant1 has 100 reserved CU, if he use 120 CU actually, 100 CU is reserved resource and 20 CU is on-demand resource, we can control the limitation of reserved resource via min concept of elastic-quota, but there's no approach to control the limitation of on-demand resource for now.

Therefore, I propose to introduce a new concept "min-excess" to limit on-demand resource usage under control, "min-excess" represents the limitation of excess part out of min, meanwhile we need to record the "min-excess-used" resource. For the leaf quotas, "min-excess-used" resource equals (used - min), and for parent quotas, it is the sum of the "min-excess-used" resource from all the leaf quotas belong to them.

Take a usage scenario for example:

|- product  min: 300, max: 500, used: 300, min-excess: 100, min-excess-used: 100
   |- tenant1  min: 100, max: 300, used: 150, min-excess-used: 50
   |- tenant2  min: 100, max: 300, used: 150, min-excess-used: 50
   |- tenant3  min: 100, max: 300, used: 0

Both tenant1 and tenant2 have utilized 50 units of on-demand resource, resulting in an actual usage of 100 units for the product-level on-demand resource. With the min-excess=100 configuration on the product quota, now there's a cap on the on-demand resource usage at the product quota level, tenant1 and tenant2 won't get more resource, meanwhile tenant3 can still start workloads within the reserved resource.

This feature is disabled by default, with almost no resource usage, and can be enabled by the --feature-gates argument.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 80.82192% with 14 lines in your changes missing coverage. Please review.

Project coverage is 66.04%. Comparing base (13a7107) to head (2befbc2).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
.../scheduler/plugins/elasticquota/core/quota_info.go 67.74% 10 Missing ⚠️
pkg/scheduler/plugins/elasticquota/plugin.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2289    +/-   ##
========================================
  Coverage   66.04%   66.04%            
========================================
  Files         454      454            
  Lines       53438    53568   +130     
========================================
+ Hits        35295    35381    +86     
- Misses      15601    15641    +40     
- Partials     2542     2546     +4     
Flag Coverage Δ
unittests 66.04% <80.82%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TaoYang526 TaoYang526 marked this pull request as draft December 5, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant