K8s Cluster
- class lightning_sdk.k8s_cluster.K8sCluster(cloud_account)
Bases:
objectInteract with a Kubernetes cluster to retrieve GPU billing usage.
Connect to a Kubernetes cluster by cloud account.
- Parameters:
- get_billing_usage(start_date=None, end_date=None, print_data=False)
Retrieve GPU billing usage for this cluster.
- Parameters:
start_date (
Optional[datetime]) – UTC start of the query window. Defaults to None (no lower bound).end_date (
Optional[datetime]) – UTC end of the query window. Defaults to None (no upper bound).print_data (
bool) – Whether to print the raw usage data to stdout. Defaults to False.start_date (datetime | None)
end_date (datetime | None)
print_data (bool)
- Returns:
Hourly GPU usage breakdown and the total billed GPU count.
- Return type:
- class lightning_sdk.k8s_cluster.K8sUsageResponse(hours, total_usage)
Bases:
objectAggregated GPU billing response for a queried time range.
- Parameters:
hours (List[HourlyUsage])
total_usage (float)
- hours
Per-hour breakdown of GPU usage.
- total_usage
Sum of billed GPUs across all hours.
- class lightning_sdk.k8s_cluster.HourlyUsage(time, available_gpus, billed_gpus)
Bases:
objectGPU billing data for a single one-hour window.
- time
Start of the hour (UTC).
- available_gpus
Total GPUs allocated during this hour.
- billed_gpus
GPUs that were actively billed during this hour.
Was this page helpful?
Thanks for the feedback.