Skip to content

gpu — backend: DRA ResourceClaim/ResourceSlice/DeviceClass watcher + join with PodResources #208

Description

@gnana997

Part of #202.

Context

DRA (Dynamic Resource Allocation) is GA in K8s 1.34 (Sept 2025). Workloads can now request GPUs via ResourceClaimTemplate instead of legacy nvidia.com/gpu: 1. Periscope needs to watch the DRA core types (ResourceClaim / ResourceSlice / DeviceClass under resource.k8s.io/v1) and join them with the PodResources allocation snapshot to produce a unified "this pod is on this GPU" view that covers both legacy and DRA cases.

This is post #4 of the blog series: "We migrated nvidia.com/gpu to DRA. Here's everything that broke."

Acceptance

  • Informer for resource.k8s.io/v1 ResourceClaim + ResourceSlice + DeviceClass
  • Join: PodResourceClaimResourceSlice → physical GPU UUID
  • Cache the mapping (UUIDs in ResourceSlice.spec.devices[] are opaque strings)
  • Pod ↔ GPU map (sub-task #) renders both legacy and DRA pods uniformly — operator should not see a difference unless they want to filter by allocation type
  • Migration validation view: cluster summary "X pods on legacy, Y pods on DRA" with per-namespace breakdown
  • Graceful when cluster is pre-1.34 (no resource.k8s.io/v1 API group): skip the informer, no errors

Files this likely touches

  • New: internal/gpu/dra/informer.go
  • Update: internal/gpu/store/index.go to merge DRA + legacy

Dependencies

Blocks on: gpu — backend: PodResources DaemonSet (the join target)

Notes for contributors

  • DRA core types: resource.k8s.io/v1 ResourceClaim / ResourceSlice / DeviceClass
  • ResourceClaim.status.allocation.devices[].deviceID is a string — map back via ResourceSlice.spec.devices[] to find the physical GPU UUID
  • Cache the deviceID → UUID mapping (rebuild on ResourceSlice changes)
  • Test against kubernetes-sigs/dra-driver-nvidia-gpu (the upstream DRA reference)
  • DRA-driver issues to be aware of: #897, #652 (DCGM correlation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions