Skip to content

Commit cd21512

Browse files
design-proposal(quota): record AAQ in alternatives considered
Evaluates KubeVirt's Application Aware Quota, raised in review: it prices launchers by declared guest size and removes the additive overhead, but its accounting unit is the pod, non-schedulable resources fall back to a managed native ResourceQuota, and its cluster quota is a flat selector whose non-schedulable half exists only on OpenShift. Rejected as a replacement, recorded as complementary to the operational limit. Signed-off-by: Mattia Eleuteri <[email protected]>
1 parent ca91cf5 commit cd21512

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • design-proposals/tenant-quota-reservation

‎design-proposals/tenant-quota-reservation/README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,17 @@ A `ValidatingAdmissionPolicy` in CEL. Rejected: CEL cannot aggregate across obje
492492
**Preset table.**
493493
Exported as a ConfigMap by the platform chart, keeping exactly one copy of the table. Not rejected; recorded as an open question above.
494494

495+
**An existing quota engine: KubeVirt's Application Aware Quota.**
496+
[AAQ](https://github.com/kubevirt/application-aware-quota) attacks the same overhead symptom and was raised in review by @Barakmor1. Its `vmiCalcConfigName: VirtualResources` mode prices a launcher by the guest size declared on the `VirtualMachineInstance` rather than by the pod's requests, and its `overhead_calculator` reads the KubeVirt CR instead of hardcoding a figure that moves between releases. On that axis it is strictly better than `--tenant-quota-buffer-percent`, and if additive overhead were the only failure described here, adopting it would beat writing anything new.
497+
498+
It cannot carry the tenant contract, for three reasons its extension mechanism does not reach. The accounting unit is the pod: `AaqEvaluator.GroupResource()`, `Handles` and `Matches` all delegate to the upstream pod evaluator, and the sidecar interface is `PodUsageFunc(podToEvaluate *corev1.Pod, existingPods []*corev1.Pod)`. A sidecar can therefore price a pod from the custom resource that owns it, as the built-in `VirtLauncherCalculator` already does through the VMI informer, and a Cozystack sidecar reading `spec.reservation` would be a legitimate implementation of the cost function. But there is no entry point for "a custom resource was created", so nothing charges a workload whose pods do not exist yet. A stopped VM would cost nothing, which is the opposite of a reservation.
499+
500+
Only schedulable resources reach that evaluation in the first place. `FilterNonScheduableResources` retains `pods`, `cpu`, `memory` and `ephemeral-storage` with their `requests.`/`limits.` forms, and the rq-controller strips everything else, `requests.storage` explicitly included, into a managed native `ResourceQuota`. A tenant's `storage` and `services.loadbalancers` would keep being counted from `status.used`, leaving that part of the quota on exactly the failure mode described in [The problem](#the-problem).
501+
502+
Finally, `ApplicationAwareClusterResourceQuota` selects namespaces by label or annotation, flat, so carve-outs and children sharing an ancestor's pool cannot be expressed. Off OpenShift its managed counterpart is OpenShift's own `ClusterResourceQuota`, which upstream documents as created only on that distribution, so non-schedulable resources have no cluster-scoped enforcement path there at all.
503+
504+
Rejected as a replacement, recorded as complementary. AAQ enforces with a scheduling gate and an event on the pod, where this design rejects the tenant's own create, which is the shape the sub-tenant declaration gate already requires. The two govern different limits in the sense of [Two limits, two owners](#1-two-limits-two-owners): should the platform later want the operational side made exact rather than merely safe, AAQ's overhead calculator is the reference to use, and nothing here forecloses it.
505+
495506
**Enforcement point.**
496507
Keep `EnforcedHard` and the allocated quota alongside reservation accounting. Rejected: it computes a clamp from reservations and applies it to pod requests, mixing the two units one level above where they are mixed today.
497508
A transactional reservation counter with optimistic concurrency, eliminating the concurrent-create overshoot. Rejected as unnecessary: once operational safety no longer depends on the counter, an overshoot bounded by one application is harmless, and it is the same trade-off the OpenShift reconciler this design descends from already accepts.

0 commit comments

Comments
 (0)