Skip to content

[FEATURE] GPUQuota status reconciler (#416 story 2) #1093

Description

@Defilan

Feature Description

GPUQuota status reconciler that maintains live Status.UsedGPUCount and Status.UsedVRAMBytes by summing the InferenceServices in the quota's scope. Story 2 of #416.

Problem Statement

As an operator, I want each GPUQuota to show current utilization so I can see how close a team is to its cap before deployments start getting rejected.

Proposed Solution

Add internal/controller/gpuquota_controller.go:

  • Watch GPUQuota plus InferenceService (map InferenceService events back to the matching GPUQuotas).
  • Resolve scope: NamespaceRef (single namespace) or Selector (label-matched namespaces). Reject specs that set both (belt-and-suspenders; primary validation is in the webhook story).
  • Aggregate GPU count and VRAM across in-scope InferenceServices; write Status.UsedGPUCount / Status.UsedVRAMBytes within one reconcile.
  • Owner/finalizer handling so GPUQuota deletion cleans up cleanly.

Scope

In: status aggregation reconciler + wiring in cmd//manager setup. Out: admission decisions (that is #416-C/#416-D). This story never rejects anything; it only reports usage.

Acceptance Criteria (provable in-workspace)

  • Envtest: create a GPUQuota and several InferenceServices in scope; assert UsedGPUCount/UsedVRAMBytes aggregate correctly and update when an InferenceService is added/removed.
  • Envtest: deleting the GPUQuota reconciles cleanly (no leaked finalizer).
  • make test and make lint pass; cross-arch lint clean.

Dependencies

Priority

  • High

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions