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 ​
status object ​resourceUsage object ​
ResourceUsage contains the aggregated result of the queries to the tenant cluster's nodes.
resourceUsage object ​nodes required integer ​
Nodes is the total count of nodes attached to the tenant cluster.
nodes required integer ​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.
capacity object ​gpus object[] ​
GPUs is the accelerator usage across all attached nodes, broken down by GPU type
(vendor and model).
gpus object[] ​vendor required string ​
Vendor is a normalized accelerator vendor id, e.g. "nvidia", "amd", "intel".
vendor required string ​model string ​
Model is the hardware model when known, empty otherwise.
model string ​allocatable required integer ​
Allocatable is the total number of schedulable units of this type across all nodes.
allocatable required integer ​physical required integer ​
Physical is the total number of physical accelerators of this type across all nodes.
physical required integer ​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.
- kubectl
- curl
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"
Run the following curl command:
# Exchange my-object in the url below with the name of the VirtualClusterInstance
curl -s -X GET --insecure \
"https://$LOFT_DOMAIN/kubernetes/management/apis/management.loft.sh/v1/namespaces/your-namespace/virtualclusterinstances/my-object/resourceusage" \
-H "Authorization: Bearer $ACCESS_KEY"