[Reference Architecture]: Gradiant - A multi-tenant AI developer platform with Kubernetes DRA and NVIDIA MIG

Aperta Adatta ai principianti
#2,151 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
85/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
kubernetes, prometheus
Ambito
documentation

Direzione di ricerca

Questa issue presenta un’architettura di riferimento per la piattaforma GPU condivisa di Gradiant. Inizia leggendo la descrizione dell’architettura, in particolare le sezioni sulla governance del progetto, sul partizionamento delle GPU e sulla contabilizzazione dei costi. Verifica la coerenza e la completezza del testo presentato rispetto ai diagrammi e alle tabelle; il lavoro è concluso quando l’architettura di riferimento è pronta per la pubblicazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

architecture-submission stage/010-actionable
Organization or Team Name

Gradiant

Organization Website

https://gradiant.org/

Contact

Carlos Giraldo Rodriguez, Platform Engineering Team

Contact Email

[email protected]

Organization Size

250 employees

Target User Base Size

Approximately 200 researchers and developers working across Gradiant's projects.

Industries

Research and Development, Information and Communication Technologies

Tags

kubernetes, dynamic-resource-allocation, gpu, nvidia-mig, multitenancy, platform-engineering, private-cloud, openstack, gitops, observability, cost-allocation

Relevant CNCF Projects
Kubernetes | https://github.com/cncf/artwork/blob/main/projects/kubernetes/icon/color/kubernetes-icon-color.svg | | | Orchestrates project workloads and allocates GPU resources through Dynamic Resource Allocation.
Keycloak | https://github.com/cncf/artwork/blob/main/projects/keycloak/icon/color/keycloak-icon-color.svg | | | Manages project group membership and provides identity and group claims for namespace access.
Flux | https://github.com/cncf/artwork/blob/main/projects/flux/icon/color/flux-icon-color.svg | | | Reconciles platform and project configuration from Git.
Prometheus | https://github.com/cncf/artwork/blob/main/projects/prometheus/icon/color/prometheus-icon-color.svg | | | Collects GPU allocation, device capacity and pricing metrics for observability and accounting.
OpenCost | https://github.com/cncf/artwork/blob/main/projects/opencost/icon/color/Opencost_Icon_Color.svg | | | Supplies resource cost data combined with the platform's DRA-aware GPU accounting.
Backstage | https://github.com/cncf/artwork/blob/main/projects/backstage/icon/color/backstage-icon-color.svg | | | Provides a single developer portal for project registration, Headlamp access and a billing dashboard showing current project costs.
Describe your organisation

Gradiant is a technology center with approximately 200 researchers working in areas including intelligence, connectivity and cybersecurity. Its researchers and developers work across projects that need access to shared computing infrastructure, including GPU accelerators.

Describe your entity and/or team

The platform team brings together private cloud infrastructure, Kubernetes operations and developer tooling to provide shared services to project teams.

Brief overview of your architecture and any potential goals you are trying to achieve with it?

Gradiant operates a private cloud based on OpenStack with NVIDIA H100 GPU servers. As AI adoption grew, dedicating GPUs to individual projects became difficult to sustain: some devices remained idle while other projects waited for capacity.

In the original deployment, GPUs were attached to project virtual machines through PCI passthrough. Releasing a GPU for another project required destroying its VM. GPU availability was therefore coupled to the lifecycle of infrastructure owned by a particular project.

We built an operational, self-service platform that shares accelerator capacity across projects through Kubernetes Dynamic Resource Allocation, NVIDIA Multi-Instance GPU partitioning and a common developer interface. Project groups, namespace permissions, device quotas and cost attribution provide the governance needed to operate that shared capacity.

Goals
  • Share H100 capacity across projects, including workloads that need only part of a GPU.
  • Give developers a consistent way to request, inspect and release GPU resources.
  • Connect project membership to namespace access and resource limits.
  • Attribute accelerator costs to projects through observed device allocations.
  • Manage platform and infrastructure configuration declaratively with GitOps.
Architecture overview

The shared gradiant-projects Kubernetes cluster runs project workloads in separate namespaces. Its GPU workers are OpenStack VMs managed through Cluster API and the Cluster API Provider OpenStack. GPUs remain attached to those worker VMs, while Kubernetes manages their allocation to project workloads.

Backstage provides a single portal where developers register projects, access Headlamp and view a billing dashboard with current project costs. Headlamp, extended with a custom DRA plugin, provides the Kubernetes interface for managing GPU claims. Grafana provides the cost visualizations accessible through the portal.

Keycloak manages project group membership and exposes identity and group claims through OpenID Connect. Kubernetes RoleBindings map those groups to permissions in the corresponding project namespaces.

flowchart TB
  accTitle: Gradiant shared GPU platform architecture
  accDescr: Backstage is the single developer portal for project registration, Headlamp access and current project costs in a billing dashboard. GitOps provisions namespaces and infrastructure. Keycloak groups map to namespace permissions. Headlamp provides DRA requests on OpenStack GPU worker VMs. The exporter and Prometheus supply allocation data for costs alongside OpenCost, displayed in Grafana through the portal.

  subgraph ACCESS[Project registration and access]
    B[Backstage developer portal]
    K[Keycloak project groups and members]
    H[Headlamp with DRA plugin]
  end

  subgraph OPS[Declarative platform management]
    G[Git configuration]
    F[Flux and Tofu Controller]
    C[Cluster API and OpenStack provider]
    G --> F
    F --> C
  end

  subgraph SHARED[Shared Kubernetes cluster: gradiant-projects]
    N[Project namespaces: RBAC and quotas]
    R[Project ResourceClaims and workloads]
    D[DRA and NVIDIA driver: dynamic MIG]
    W[GPU worker VMs with H100 access]
    N --> R
    R --> D
    D --> W
  end

  subgraph COST[Observability and project costs]
    E[kube-dra-exporter]
    P[Prometheus allocation and price history]
    O[OpenCost resource costs]
    A[DRA-aware cost integration]
    V[Grafana project dashboards]
    E --> P
    P --> A
    O --> A
    A --> V
  end

  B --> G
  B -->|Access Headlamp| H
  B -->|View current project costs| V
  F --> N
  C --> W
  K -->|OIDC group claims mapped through RoleBindings| N
  H -->|Namespace permissions enforced by Kubernetes| R
  R --> E
  D --> E
Project identity and resource governance

Each project has a namespace, group-based access and resource quotas. Keycloak supplies the project group memberships used by Kubernetes RBAC; namespace RoleBindings grant the corresponding permissions. DeviceClasses define the GPU resources projects can request, and ResourceQuota limits the number of devices requested from each class.

Control Responsibility
Backstage developer portal Registers projects and provides access to Headlamp and the billing dashboard with current project costs.
Project groups in Keycloak Represent members and administrators for access management.
Namespace RBAC Grants project groups permissions within their namespace.
DeviceClasses Define the selectable GPU and MIG resource catalog.
ResourceQuota Limits CPU, memory, storage, pods and device quantities by class.
Namespace-based accounting Attributes allocated resource costs to the project.

Generic GPU, MIG and VFIO classes have zero quota in the project template, restricting request paths outside the curated DeviceClass catalog. Quotas control how much a project may request; actual allocation also depends on physical capacity and placement constraints.

Namespace RBAC and quotas govern access and allocation. MIG provides hardware partitioning of GPU compute and memory.

Persistent storage

Project workloads use PersistentVolumeClaims backed by OpenStack Cinder through the Cinder CSI driver. These volumes provide persistent storage that can be mounted into containers for model files, datasets and workload outputs. Storage requests are governed by project namespace quotas.

The next step is to make storage easier to use from the developer portal, alongside GPU requests and cost visibility. A browser for PVC contents and S3-compatible object storage are part of that roadmap.

GPU partitioning and resource catalog

The GPU pool contains two H100 GPUs, with dynamic MIG enabled in the NVIDIA DRA driver and Kubernetes partitionable device support enabled through DRAPartitionableDevices. The platform exposes smaller GPU instances and full GPUs through a curated set of DeviceClasses.

DeviceClass Resource offered Maximum per H100 when used alone
nvidia-1g12gb MIG profile 1g.12gb 7
nvidia-1g12gb-me MIG profile 1g.12gb-me, with multimedia extension 1
nvidia-1g24gb MIG profile 1g.24gb 4
nvidia-2g24gb MIG profile 2g.24gb 3
nvidia-3g47gb MIG profile 3g.47gb 2
nvidia-4g47gb MIG profile 4g.47gb 1
nvidia-7g94gb Full GPU 1

These are alternative configurations of the same physical capacity. Their maximum counts cannot be added together, and mixed profiles can impose further placement constraints. Each DeviceClass carries an hourly price through its hourly-cost annotation and has a project-specific device quota.

GPU lifecycle and accounting

The operational flow covers request, allocation, monitoring, accounting and release. A ResourceClaim requests devices in the project's namespace. Allocation occurs when Kubernetes schedules a pod that references it; creating the claim alone does not allocate a GPU.

flowchart LR
  accTitle: GPU allocation and accounting lifecycle
  accDescr: A claim starts without a device and incurs no allocation cost. A consuming pod triggers DRA allocation. While allocated, metrics drive project cost accumulation. Removal of the last consumer clears the allocation and stops new GPU charges; a manual claim can remain for reuse.

  A[Claim exists: no allocation cost]
  B[Pod references claim]
  C[Device allocated: cost accrues]
  D[Last consumer removed]
  E[Allocation cleared: no new GPU cost]
  A --> B --> C --> D --> E
  E -->|Manual claim reused by a later pod| B

kube-dra-exporter exposes ResourceClaims, ResourceSlices and DeviceClasses as Prometheus metrics. Allocation metrics identify the claim, namespace and physical device; price metrics provide the applicable DeviceClass rate. The cost integration accumulates those rates over the observed allocation period and aggregates the result by project namespace.

Claim state Device allocation GPU allocation cost
Created, waiting for a consuming pod None None
Referenced by a pod, waiting for capacity None None
Allocated to one or more consumers Present Accumulates at the allocated devices' rates
Last consumer removed and allocation cleared None; a manual claim may still exist Stops accumulating; historical cost remains

For a fixed price, a device's allocation cost is its hourly rate multiplied by its allocated duration in hours. Rates are integrated over time to account for price changes, and a claim's cost sums all its allocated devices. This measures held capacity; GPU utilization is observed separately.

A manually created claim can remain for reuse after deallocation. A ResourceClaimTemplate creates a separate claim per pod and ties object cleanup to the pod lifecycle. Several pods referencing one named claim share one allocation and compete for its compute and memory; separate claims provide independent allocations. Shared claims are charged once, with the cost apportioned between their reserving pods for presentation.

Cloud native characteristics
Characteristic Application in this architecture
Declarative management Git stores desired configuration; Flux reconciles platform and project resources, with Tofu Controller supporting infrastructure as code.
Interoperability Kubernetes APIs, OIDC group claims and Prometheus metrics connect workload, identity and accounting components.
Observability DRA objects are exposed as metrics alongside allocation, pricing and collection health.
Portability Container workloads and Kubernetes resource definitions provide a common interface; the infrastructure provider and GPU capabilities remain environment-specific.
Resource governance Namespace permissions, device quotas and project cost attribution make shared capacity accountable.
Can you expand on why you are using those projects/services?
Technology Why it is used
Kubernetes and DRA Provide workload orchestration and a declarative API for specialized device allocation.
NVIDIA DRA driver and MIG Implement NVIDIA device handling and dynamically partition H100 capacity for smaller workloads.
Cluster API and its OpenStack provider Manage Kubernetes node VMs through declarative cluster lifecycle resources.
Keycloak Connects project groups and membership to authentication and namespace authorization.
Backstage Provides a single developer portal for project registration, Headlamp access and current project costs through the billing dashboard.
Headlamp Provides the Kubernetes UI accessed through the portal, extended to expose the DRA workflow to developers.
Flux and Tofu Controller Automate reconciliation of platform configuration and infrastructure resources.
Prometheus and Grafana Collect allocation and pricing history and present operational and cost views.
OpenCost Provides resource cost data used alongside the custom DRA GPU model.
OpenStack Supplies the private cloud and GPU-enabled worker VMs.
Cinder CSI driver Provisions persistent volumes for project workloads through Kubernetes PersistentVolumeClaims.

In our deployment, OpenCost's existing accounting did not provide the DRA allocation and MIG-profile attribution we needed. We built a complementary GPU model and combine its results with the other resource costs. The combined reports replace the corresponding GPU component to avoid double counting; OpenCost's own API remains unchanged.

What has worked well?

The platform is operational and used by developers. It combines GPU access through a shared Kubernetes cluster with project namespaces, group-based permissions and DeviceClass quotas. GPU worker VMs remain in place while allocations change between project workloads.

Backstage brings project registration, Headlamp access and current project costs into one developer portal. The Headlamp plugin gives developers a UI for requesting and inspecting GPU resources. The exporter connects those allocations to project accounting, including the transition back to an unallocated claim when the last consumer is removed. DeviceClasses provide a common vocabulary for resource selection, quota categories and prices.

What has not worked well?

The original VM and PCI passthrough workflow made reassigning GPUs between projects operationally expensive. Moving allocation into Kubernetes addressed that sharing boundary, but operating DRA required additional work beyond scheduling: developer tooling, allocation metrics and cost attribution.

We encountered GPU capacity fragmentation when small allocations such as nvidia-1g12gb were placed on different physical GPUs. This could block a full-GPU nvidia-7g94gb request even when all claims could fit with a different placement: the small allocations could share one H100, leaving another completely free.

Illustrative placement of two small claims First H100 Second H100 Full-GPU request
Fragmented placement One small allocation One small allocation Cannot fit on either GPU
Feasible combined placement Both small allocations Free Can use the second GPU

Enabling DRAPartitionableDevices resolved this behavior in our deployment. It lets the driver describe the shared physical capacity consumed by alternative device partitions, so the scheduler can account for their overlapping resource requirements. The feature became beta and enabled by default in Kubernetes 1.36.

This experience highlighted that advertising supported GPU profiles is only part of the solution: the scheduler also needs a model of their underlying physical capacity. Quotas control project entitlements, while compatible placement determines whether those requests can be satisfied together.

We currently use the Kubernetes scheduler without an additional project-level fair-share policy. The default scheduling queue orders pods by priority and then by queue timestamp for equal priorities. Pods that cannot be scheduled are retried through event-driven requeueing and backoff. This does not provide strict FIFO execution or allocate turns according to each project's historical GPU consumption. Namespace quotas limit requests, but do not decide which project should receive the next available GPU allocation. Fair access under contention is therefore a roadmap item.

Accounting is based on sampled metrics at one-minute intervals. Short allocations or transitions between observations can be missed or approximated, and telemetry gaps affect cost completeness. Missing prices and collection coverage are exposed so incomplete results can be reviewed.

What sort of "glue" have you had to develop to enable usage of your architecture?
Custom integration Purpose
Headlamp DRA plugin Manages ResourceClaims and ResourceClaimTemplates and displays DeviceClasses, ResourceSlices, allocation state and associated pods.
kube-dra-exporter Exposes allocated devices, pod reservations, device capacities and DeviceClass hourly prices to Prometheus.
DRA-aware accounting Maps devices to priced classes, integrates allocation costs, deduplicates allocations and aggregates results by project namespace.
Declarative project provisioning Connects project registration to namespaces, group-based RBAC, quotas and project-scoped Flux reconciliation.

We developed and open-sourced kube-dra-exporter to make DRA allocations observable through Prometheus. The surrounding cost integration combines these metrics with OpenCost data, while the Headlamp plugin makes the same resource model accessible to developers.

Has your architecture evolved? What lessons did you learn from previous iterations?

The architecture evolved from project VMs holding dedicated GPUs to a shared Kubernetes allocation model over GPU-enabled VMs. MIG provides smaller resource units, DRA manages allocation, and project identity connects access control to cost attribution.

The main lessons are:

  • Allocation is only one part of a shared GPU service. Teams also need access control, resource limits, developer interfaces, observability and accounting.
  • A claim object and its allocation have different lifetimes. A claim can remain without holding a GPU or accumulating new GPU cost.
  • DeviceClasses connect governance and economics. The resource catalog supplies the categories used for selection, quotas and pricing.
  • Partition placement matters as much as total free capacity. Small allocations spread across GPUs can block a full-GPU request; enabling partitionable device support resolved the placement issue we encountered.
  • Sharing a claim differs from requesting separate devices. Replicas using one claim share its allocation; a claim template gives each replica its own claim.
  • Cost visibility depends on telemetry quality. Allocation history, prices and collection coverage must be considered together.

These patterns can help other platform teams operate DRA-managed accelerators across the complete resource lifecycle.

What's next for your architecture? What are you looking to do next?

Our current focus is internal adoption: helping more researchers and developers use the platform and making common Kubernetes tasks easier to complete. Backstage provides the common entry point, while the next improvements aim to reduce the effort required to request resources, run AI workloads and manage their data.

Priority Direction Status
Developer adoption Promote the platform internally and support project teams as they start using it. Current focus
Simpler resource workflows Make common Kubernetes operations easier through the developer portal and its integrated tools. Current focus
Fair GPU scheduling Evaluate project-aware queuing and admission policies to provide fair access when projects compete for GPU capacity. Planned; policy and implementation under evaluation
Easier access to persistent files Explore a file browser for PVC contents so developers can inspect and manage data used by AI workloads. Planned improvement
Object storage for AI projects Add S3-compatible object storage, evaluating a shared service with project separation and dedicated services where needed. Planned; service model under evaluation

Cinder-backed PVCs are already available. We want to simplify how developers attach storage to their workloads and access model files, datasets and results. A PVC file browser would complement the existing volume provisioning by making stored contents easier to work with.

S3-compatible services would provide an additional storage interface for AI projects. The choice between shared and dedicated services will depend on project requirements for access control, isolation, capacity and operations. These storage improvements extend the same project-oriented experience already used for GPU access and cost visibility.

For GPU scheduling, we want to complement placement and quotas with a policy for sharing scarce capacity across projects. The evaluation will consider project shares, waiting time and allocation history, together with support for DRA claims and different MIG profiles.

Lingua principale
JavaScript
Stelle
0
Fork
10
Merge medio
1g 12h
PR unite (30g)
37

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cncf/endusers

Tutte le issue di cncf/endusers

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.