diff --git a/packages/apps/tenant/README.md b/packages/apps/tenant/README.md index 494499c97..3405d8c6b 100644 --- a/packages/apps/tenant/README.md +++ b/packages/apps/tenant/README.md @@ -126,6 +126,10 @@ A `VMInstance` reserves the `count` of each class entry and a `KubernetesNodes` GPU budgets are checked against the application's tenant pool, not recursively against every ancestor's GPU budget. +Class budgets cover class entries only: not raw-name GPU entries, which name a device-plugin resource directly, and not a KubeVirt VirtualMachine that a tenant administrator writes directly. Cap those with a native quota on the resource name, for example `nvidia.com/AD102GL_L40S: 2`, which is rendered as a `requests.` quota that Kubernetes charges against every pod requesting the resource. + +A worker pool with class entries must keep `minReplicas` at or below `maxReplicas` when it is written: a new pool starts at `minReplicas` workers, and the reservation is `maxReplicas` times the count. Pools without class entries are not affected. A rolling update of a worker pool can run up to `max(1, maxReplicas)` extra workers at once, because that is the pool's `maxSurge`, and the reservation does not include these surge workers. + **Example:** ```yaml resourceQuotas: diff --git a/packages/apps/tenant/tests/quota_gpu_keys_test.yaml b/packages/apps/tenant/tests/quota_gpu_keys_test.yaml index a3cf67425..8e76ddc85 100644 --- a/packages/apps/tenant/tests/quota_gpu_keys_test.yaml +++ b/packages/apps/tenant/tests/quota_gpu_keys_test.yaml @@ -84,6 +84,21 @@ tests: path: metadata.name pattern: ^tenant-quota$ + # Class budgets do not cover raw-name GPU entries; a native quota on the + # resource name does. The pod quota evaluator charges an extended resource + # only under requests., so that is the key that has to be rendered. + - it: caps a raw GPU resource name with a requests quota + set: + resourceQuotas: + nvidia.com/AD102GL_L40S: 1 + documentSelector: + path: kind + value: ResourceQuota + asserts: + - equal: + path: spec.hard["requests.nvidia.com/AD102GL_L40S"] + value: 1 + - it: renders nothing without resourceQuotas asserts: - hasDocuments: