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" - Replicas:
scaleops.sh/default-replicas-auto: "true" - Spot:
scaleops.sh/default-spot-auto: "true" - GPU Rightsizing:
scaleops.sh/default-gpu-auto: "true" - Java Optimization:
scaleops.sh/default-java-auto: "true"
Example - Automate with annotations:
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
scaleops.sh/default-rightsize-auto: "true"
scaleops.sh/default-replicas-auto: "true"
scaleops.sh/default-spot-auto: "true"
scaleops.sh/default-gpu-auto: "true"
scaleops.sh/default-java-auto: "true"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-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" - Replicas:
scaleops.sh/default-replicas-policy: "production" - Spot:
scaleops.sh/default-spot-policy: "spot-friendly" - GPU Rightsizing:
scaleops.sh/default-gpu-policy: "production"
Example - Set policy with annotations:
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
scaleops.sh/default-rightsize-policy: "production"
scaleops.sh/default-replicas-policy: "production"
scaleops.sh/default-spot-policy: "spot-friendly"
scaleops.sh/default-gpu-policy: "production"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 workload from workload rightsizing automation by adding scaleops.sh/exclude-automation: "true" annotation.
ScaleOps will not allow 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 rightsizing automation status of a workload by adding the scaleops.sh/force-auto 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:
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
scaleops.sh/force-auto: "true"Force Policy
Control workload rightsizing policy by adding scaleops.sh/force-policy 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:
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
scaleops.sh/force-policy: "production"Note: The scaleops-sh/auto and scaleops-sh/policy annotations are legacy aliases. For compatibility,
they are treated the same as scaleops.sh/force-auto and scaleops.sh/force-policy, respectively.

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: excludeTypes, excludedWorkloadLabels, includedWorkloadLabels, excludedWorkloadAnnotations, includedWorkloadAnnotations.
workloadAutomation:
excludeTypes:
- "DaemonSet"
- "StatefulSet"
excludeLabels:
- "team=external"
includeLabels:
- "automate=true"
excludeAnnotations:
- "company.io/manual-scaling=enabled"
includeAnnotations:
- "company.io/optimize=enabled"