Skip to main content
Version: main 🚧

Retrieve Resource Usage

Retrieve aggregated node and GPU resource usage for the tenant cluster's attached nodes, including a per-vendor GPU breakdown.

Virtual cluster resource usage example​

An example Virtual cluster resource usage:

apiVersion: management.loft.sh/v1
kind: VirtualClusterResourceUsage
metadata:
namespace: your-namespace
status:
resourceUsage:
capacity:
cpu: 48
nvidia.com/gpu: 4
gpus:
- allocatable: 4
physical: 4
vendor: amd
- allocatable: 8
physical: 8
vendor: intel
- allocatable: 4
physical: 4
vendor: nvidia
nodes: 3

Virtual cluster resource usage reference​

status object ​

resourceUsage object ​

ResourceUsage contains the aggregated result of the queries to the tenant cluster's nodes.

nodes required integer ​

Nodes is the total count of nodes attached to the tenant cluster.

capacity object ​

Capacity is a map of raw node resource names to their total amounts across all attached nodes (e.g. "cpu", "nvidia.com/gpu"). It is per-resource-name, not per-vendor: for GPUs it only includes "nvidia.com/gpu" and not other accelerator vendors, so use GPUs (not Capacity) for a cross-vendor GPU total.

gpus object[] ​

GPUs is the accelerator usage across all attached nodes, broken down by GPU type (vendor and model).

vendor required string ​

Vendor is a normalized accelerator vendor id, e.g. "nvidia", "amd", "intel".

model string ​

Model is the hardware model when known, empty otherwise.

allocatable required integer ​

Allocatable is the total number of schedulable units of this type across all nodes.

physical required integer ​

Physical is the total number of physical accelerators of this type across all nodes.

Virtual cluster resource usage (Get)​

You can retrieve the aggregated node and GPU resource usage for a tenant cluster's attached nodes through this API. capacity only ever reflects nvidia.com/gpu; use gpus for the cross-vendor breakdown.

Run the following command:

# Exchange my-object in the url below with the name of the VirtualClusterInstance
kubectl get --raw "/kubernetes/management/apis/management.loft.sh/v1/namespaces/your-namespace/virtualclusterinstances/my-object/resourceusage"