Skip to Content
ScaleOps via GitOpsWorkload Actions

Workload Actions

ScaleOps supports GitOps control for all optimization products through workload annotations. Each product can be controlled independently using product-specific annotations and configuration fields, while maintaining backward compatibility with existing generic fields.

ℹ️

Version 1.21.0 Update: ScaleOps introduced GitOps control for Replicas Optimization and Spot Optimization, as well as updates to Workload Rightsizing fields. For older versions, follow the backward compatibility notes to configure Workload Rightsizing via GitOps.

Automating a workload using annotation

For granular control over each optimization product, use the following product-specific annotations:

  • Rightsizing: scaleops.sh/default-rightsize-auto: "true"
  • GPU Rightsizing: scaleops.sh/default-gpu-auto: "true"
  • GPU Memory Optimization: scaleops.sh/default-vllm-auto: "true"
  • Java Recommendation: scaleops.sh/default-java-recommendation: "true"
  • Java Optimization: scaleops.sh/default-java-auto: "true"
  • Replicas: scaleops.sh/default-replicas-auto: "true"
  • Pod Scheduling: scaleops.sh/default-pod-scheduling-auto: "true"
  • Downscaler: scaleops.sh/default-downscaler-auto: "true"
  • Spot: scaleops.sh/default-spot-auto: "true"

Example - Automate with annotations:

apiVersion: apps/v1 kind: Deployment metadata: annotations: scaleops.sh/default-rightsize-auto: "true" scaleops.sh/default-gpu-auto: "true" scaleops.sh/default-vllm-auto: "true" scaleops.sh/default-java-recommendation: "true" scaleops.sh/default-java-auto: "true" scaleops.sh/default-replicas-auto: "true" scaleops.sh/default-pod-scheduling-auto: "true" scaleops.sh/default-downscaler-auto: "true" scaleops.sh/default-spot-auto: "true"
ℹ️

UI action take precedence over annotations. Thus, UI action on a workload permanently disables the annotation’s effect for that workload.

ℹ️

The scaleops.sh/default-vllm-auto annotation is accepted on any workload, but it only takes effect on workloads ScaleOps detects as vLLM workloads. See GPU Memory Optimization.

ℹ️

GPU workloads: GPU Rightsizing automation and Workload Rightsizing automation are enabled together. While GPU automation is enabled, scaleops.sh/default-rightsize-auto: "false" is ignored.

Note: scaleops.sh/default-auto: "true" is supported to set default automation for Workload Rightsizing for backward compatability.

Setting workload policy

Control workload’s default policy with annotation.

For granular control over each optimization product, use the following product-specific annotations:

  • Rightsizing: scaleops.sh/default-rightsize-policy: "production"
  • GPU Rightsizing: scaleops.sh/default-gpu-policy: "real-time" (see GPU policies)
  • GPU Memory Optimization: scaleops.sh/default-gpu-memory-policy: "vllm-memory-aware"
  • Replicas: scaleops.sh/default-replicas-policy: "production"
  • Pod Scheduling: scaleops.sh/default-pod-scheduling-policy: "high-availability"
  • Downscaler: scaleops.sh/default-downscaler-schedule: "nights"
  • Spot: scaleops.sh/default-spot-policy: "spot-friendly"

Example - Set policy with annotations:

apiVersion: apps/v1 kind: Deployment metadata: annotations: scaleops.sh/default-rightsize-policy: "production" scaleops.sh/default-gpu-policy: "real-time" scaleops.sh/default-gpu-memory-policy: "vllm-memory-aware" scaleops.sh/default-replicas-policy: "production" scaleops.sh/default-pod-scheduling-policy: "high-availability" scaleops.sh/default-downscaler-schedule: "nights" scaleops.sh/default-spot-policy: "spot-friendly"
ℹ️

UI action take precedence over annotations. Thus, UI action on a workload permanently disables the annotation’s effect for that workload.

Note: scaleops.sh/default-policy: "policy-name" is supported to set a specific policy for Workload Rightsizing for backward compatibility.

Excluding workload

Exclude a workload from all ScaleOps automation (Rightsizing, GPU, vLLM, Java, Replicas, Downscaler, Pod Scheduling, and Spot) by adding the scaleops.sh/exclude-automation: "true" annotation.

ScaleOps will not allow any automation on this workload. If the workload is already automated, adding the annotation will unautomate the workload.

Removing this annotation after excluding a workload will allow the recommendation to be controlled again and will be automatically automated if the namespace/cluster is automated.

Example:

apiVersion: apps/v1 kind: Deployment metadata: annotations: scaleops.sh/exclude-automation: "true"

Excluding workload from Java observability

Exclude a workload from Java observability by adding scaleops.sh/jmx-injection-disabled: "true" annotation. This prevents the JMX init container from being injected into the workload.

⚠️

Workloads that are already enabled with Java observability (and have the init container injected) will be evicted when excluded, so the injection can be removed.

Example:

apiVersion: apps/v1 kind: Deployment metadata: annotations: scaleops.sh/jmx-injection-disabled: "true"

Force Override

Force Automation

Change the workload automation status of a workload by adding the force annotation.

This action takes precedence over other annotations and UI actions, except for the exclude annotation.

ℹ️

Note: Removing the annotation will not restore the automation status to its previous state.

Example of forcing automation: Available in v1.34.4+

apiVersion: apps/v1 kind: Deployment metadata: annotations: scaleops.sh/force-rightsize-auto: "false" scaleops.sh/force-gpu-auto: "false" scaleops.sh/force-vllm-auto: "false" scaleops.sh/force-java-observability-auto: "false" scaleops.sh/force-java-auto: "false" scaleops.sh/force-replicas-auto: "false" scaleops.sh/force-downscaler-auto: "false" scaleops.sh/force-pod-scheduling-auto: "false" scaleops.sh/force-spot-auto: "false"
ℹ️

Before ScaleOps v1.34.4, force automation was supported only for rightsizing, via the scaleops.sh/force-auto annotation (available since v1.4.30). That legacy annotation remains supported for backward compatibility, although we advise using the modern scaleops.sh/force-rightsize-auto.

Force annotations can also be set on a namespace. See Force annotations on a namespace.

Force Policy

Control workload policy by adding force annotation.

This action takes precedence over other annotations and UI actions, except for the exclude annotation.

ℹ️

Note: Removing the annotation will not restore the policy to its previous state.

Example: Available in v1.34.4+

apiVersion: apps/v1 kind: Deployment metadata: annotations: scaleops.sh/force-rightsize-policy: high-availability scaleops.sh/force-gpu-policy: inference scaleops.sh/force-gpu-memory-policy: vllm-memory-aware scaleops.sh/force-replicas-policy: performance scaleops.sh/force-downscaler-schedule: weekends scaleops.sh/force-pod-scheduling-policy: high-availability scaleops.sh/force-spot-policy: always-spot
ℹ️

Before ScaleOps v1.34.4, force policy was supported only for rightsizing, via the scaleops.sh/force-policy annotation (available since v1.4.30). That legacy annotation remains supported for backward compatibility, although we advise using the modern scaleops.sh/force-rightsize-policy.

Force policy annotations can also be set on a namespace. See Force annotations on a namespace.

Note: The scaleops-sh/auto and scaleops-sh/policy annotations are legacy aliases. For compatibility, they are treated the same as scaleops.sh/force-rightsize-auto and scaleops.sh/force-rightsize-policy, respectively.

Force Annotation

Automation and Exclude by workload annotations and labels

Configure via the UI

You can manage workload operations in the ScaleOps UI. Click Settings, General and see Workload operations. In this section you can control Workload Rightsizing automation and exclude from automatoin based on existing workload annotations and labels.

  • Excluded workload types from automation: Select workload types that will be excluded from automation.
  • Excluded workload labels: Workloads with selected labels will not be automated
  • Automated workload labels: Workloads with selected labels will be automated
  • Excluded workload annotations: Workloads with selected annotations will not be automated
  • Automated workload annotations: Workloads with selected annotations will be automated

Note: These actions will take place in accordance with Exclude Action (for all exclusions) and Default Action (for all automation). Learn more in Action Precedence.

Configure via helm

Configure automation and exclusions with the following Helm values under workloadAutomation: excludeTypes, excludeLabels, includeLabels, excludeAnnotations, and includeAnnotations.

Label and annotation selectors use the format "key=value". The value may be an exact match or a regex pattern — ScaleOps auto-detects regex when the value contains special characters such as .*, +, ?, |, ^, or $. This matches the behavior documented for custom namespace labels.

FieldDescription
excludeTypesExclude workload types from automation (e.g. DaemonSet, StatefulSet).
excludeLabelsExclude workloads by label. Format: "key=value" or "key=regex".
includeLabelsInclude (auto-enable) workloads by label. Format: "key=value" or "key=regex".
excludeAnnotationsExclude workloads by annotation. Format: "key=value" or "key=regex".
includeAnnotationsInclude (auto-enable) workloads by annotation. Format: "key=value" or "key=regex".
workloadAutomation: excludeTypes: - "DaemonSet" - "StatefulSet" excludeLabels: - "team=external" - "app=batch-.*" # regex pattern for value includeLabels: - "automate=true" - "env=prod.*" # regex pattern for value excludeAnnotations: - "company.io/manual-scaling=enabled" - "company.io/tier=non-prod.*" # regex pattern for value includeAnnotations: - "company.io/optimize=enabled"

Per-product selectors

Use the productAutomation Helm value to apply include/exclude selectors to a single product instead of all workloads. Like workloadAutomation, it is set in your ScaleOps Helm values file.

Each product accepts excludeLabels, includeLabels, excludeAnnotations and includeAnnotations, in the same "key=value" / "key=regex" format. To select workloads by their namespace’s labels, see Per-product namespace selectors.

For Workload Rightsizing, the product-less top-level workloadAutomation selectors above are available in earlier versions Available in v1.27.1+. productAutomation.rightsize is available from 1.34.13.

Supported products: rightsize, hpa, spot, gpu, vllm, java, downscaler and scheduleBlockers Available in v1.34.13+, and podPlacement Available in v1.35.1+. podPlacement is exclude-only: it accepts only the exclude* keys.

A product’s exclude selectors take precedence over its include selectors. A matching exclude turns that product off for the workload without excluding the workload from other products.

# Helm values productAutomation: rightsize: # (v1.34.13+) includeLabels: - "automate=true" excludeAnnotations: - "company.io/manual-scaling=enabled" hpa: # (v1.34.13+) excludeLabels: - "tier=critical" includeAnnotations: - "company.io/optimize=enabled" spot: # (v1.34.13+) includeLabels: - "workload-type=stateless" excludeAnnotations: - "company.io/spot=disabled" gpu: # (v1.34.13+) includeLabels: - "gpu-optimize=true" excludeAnnotations: - "company.io/gpu=manual" vllm: # (v1.34.13+) includeAnnotations: - "company.io/vllm=enabled" excludeLabels: - "vllm-optimize=false" java: # (v1.34.13+) includeLabels: - "runtime=java" excludeAnnotations: - "company.io/java=manual" downscaler: # (v1.34.13+) includeLabels: - "downscale=true" excludeAnnotations: - "company.io/downscale=disabled" scheduleBlockers: # (v1.34.13+) excludeLabels: - "tier=critical" includeAnnotations: - "company.io/schedule-blockers=enabled" podPlacement: # exclude-only (v1.35.1+) excludeLabels: - "placement=fixed" excludeAnnotations: - "company.io/placement=manual"