Skip to main content
Version: v1.2.x

ScalingPolicy Configuration Reference

This page provides technical reference information for configuring ScalingPolicy resources. For step-by-step instructions, refer to Create and Manage Scaling Policies. For the raw resource spec, refer to the ScalingPolicy CRD documentation.

Complete ScalingPolicy Example

A ScalingPolicy is a namespaced resource in the spectrocloud.com/v1alpha1 API group. You must specify at least one of cpu or gpu scaling configurations.

apiVersion: spectrocloud.com/v1alpha1
kind: ScalingPolicy
metadata:
name: my-combined-policy
namespace: my-project-namespace
spec:
cpu:
scaleUpThreshold: 80
scaleDownThreshold: 20
scaleUpDuration: 5m
scaleDownDuration: 10m
gpu:
- variant: 'NVIDIA H100 PCIe | 80 GB'
scaleUpThreshold: 85
scaleDownThreshold: 15
scaleUpDuration: 3m
scaleDownDuration: 8m
cpuResourceBounds:
minCPUCount: 4
maxCPUCount: 64
gpuResourceBounds:
- variant: 'NVIDIA H100 PCIe | 80 GB'
minGPUCount: 1
maxGPUCount: 16
cooldownDuration: 15m
abortDuration: 30m

spec

FieldTypeDefaultRequiredDescription
cpuCPUScalingCPU scaling configuration. Required if gpu is not specified.
gpu[]GPUScalingGPU scaling configuration per GPU variant. Required if cpu is not specified.
cpuResourceBoundsCPUResourceBoundsAggregate CPU count bounds across all nodes in the pool.
gpuResourceBounds[]GPUResourceBoundsAggregate GPU count bounds per GPU variant. Each entry must correspond to a variant in gpu.
cooldownDurationduration15mWaiting period after a successful scaling action before the next scaling decision.
abortDurationduration30mTimeout for an ongoing scale-up operation. When exceeded, pending nodes that have not reached Healthy status are removed; nodes that provisioned successfully are retained. Scale-down operations are never aborted.

spec.cpu and spec.gpu[*]

Both cpu and each gpu entry use the same set of scaling parameters.

FieldTypeDefaultRequiredDescription
scaleUpThresholdinteger80Utilization percentage above which scale-up is triggered. Must be between 1 and 100. Must be greater than scaleDownThreshold.
scaleDownThresholdinteger20Utilization percentage below which scale-down is triggered. Must be between 0 and 99. Must be less than scaleUpThreshold.
scaleUpDurationduration5mDuration for which utilization must remain consistently above scaleUpThreshold before scale-up is triggered.
scaleDownDurationduration10mDuration for which utilization must remain consistently below scaleDownThreshold before scale-down is triggered.

Each gpu entry also requires:

FieldTypeDefaultRequiredDescription
variantstringGPU variant identifier (for example, "NVIDIA H100 PCIe | 80 GB"). GPU variants are displayed in the UI in the format "GPU model - per-GPU memory". The controller matches this value against GPU variants present on allocated hosts in the worker pool. Entries for GPU variants not present in the pool are silently ignored.

spec.cpuResourceBounds

FieldTypeDefaultRequiredDescription
minCPUCountintegerMinimum aggregate CPU count across all nodes in the pool. Must be at least 1.
maxCPUCountintegerMaximum aggregate CPU count across all nodes in the pool. Must be at least 1. Must be greater than or equal to minCPUCount.

spec.gpuResourceBounds[*]

FieldTypeDefaultRequiredDescription
variantstringGPU variant identifier. Must match a variant defined in spec.gpu.
minGPUCountintegerMinimum aggregate GPU count across all nodes for this variant. Must be at least 1.
maxGPUCountintegerMaximum aggregate GPU count across all nodes for this variant. Must be at least 1. Must be greater than or equal to minGPUCount.

Attach a Policy to a Compute Pool

A Compute Pool opts in to autoscaling by referencing a ScalingPolicy through scalingPolicyRef in its clusterVariant configuration. Refer to Autoscaling Configuration in the ComputePool Configuration reference for the manifest paths and scaling behavior details.