mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
feat(api): check GPU budgets when a VM or a worker pool is written
GPU budgets are not pod resources, so ResourceQuota cannot enforce them. Until the pool-wide admission gate is available, the API server needs to check declared class reservations to avoid accepting applications that exceed a tenant's budget. Reusing its inputs and pool arithmetic keeps the eventual switch from changing admission decisions. Tenant quota allocation must account for those reservations because ResourceQuota usage cannot report them. Ordinary-resource accounting must retain GPU-only descendants in the parent's pool, matching the tenant chart and runtime controller. Unsupported keys in the GPU budget domain must not create an unenforced promise when the chart omits them. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
8 files changed
+857
-32
No files matched your search
@@ -340,7 +340,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
|
||||
// ownedNamespace maps a tenant HelmRelease (name "<prefix><app>" in namespace
|
||||
// hrNamespace) to the namespace that tenant owns. It mirrors
|
||||
// REST.computeTenantNamespace in the aggregated apiserver.
|
||||
// computeTenantNamespace in the aggregated apiserver.
|
||||
func ownedNamespace(hrNamespace, appName string) string {
|
||||
switch {
|
||||
case hrNamespace == rootTenantNamespace && appName == "root":
|
||||
|
||||
Reference in new issue
Block a user