proposal: min-excess control for quota #2289
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. 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:
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
make test