Skip to Content
ScaleOps via GitOpsNamespace Actions

Namespace Actions

ScaleOps supports defining policies and automating a namespace using CRD or annotations.

ℹ️

Version 1.33.4 Update: ScaleOps introduced GitOps control for GPU Optimization, GPU Memory Optimization, Java Recommendation, Replicas Optimization, Downscaler, Pod Scheduling Optimization, and Spot Optimization.

Annotations

Annotations on a namespace set the automation state and policy of every workload in it, for each optimization product. There are three kinds:

  • Default (scaleops.sh/default-<product>-auto, scaleops.sh/default-<product>-policy): sets the starting automation state and policy. UI actions, the AutomatedNamespace CRD and cluster-level automation can change it.
  • Force (scaleops.sh/force-<product>-auto, scaleops.sh/force-<product>-policy): pins the automation state and policy. UI actions, the CRD and cluster-level automation can’t change it.
  • Exclude (scaleops.sh/exclude-automation): turns automation off for every product and takes precedence over everything else.

For the full order across annotations, UI actions, the CRD and cluster-level automation, see Action Precedence.

How default annotations behave

A default annotation on a namespace applies to new workloads and to existing workloads. It applies only to workloads whose automation or policy for that product wasn’t already set by a UI action, an AutomatedNamespace CR or cluster-level automation. Once a workload is changed that way, the namespace annotation no longer affects it for that product. To hand control back to the annotation, follow Reverting Workload Control to Default Actions.

A workload’s own default annotation takes precedence over the namespace annotation. See Workload Actions.

ScaleOps keeps tracking the annotation after applying it:

  • Changing the value updates every workload that the annotation controls.
  • Removing an automation annotation (default-<product>-auto) turns automation off for workloads it was controlling, unless a workload-level default annotation still applies. For Workload Rightsizing and GPU Rightsizing, a default set by a Custom Owner Grouping (defaultAuto, defaultGpuAuto) takes over instead, if one matches the workload.
  • Removing a policy annotation (default-<product>-policy) changes the policy of the workloads it was controlling. What they fall back to depends on the product:
ProductPolicy after the annotation is removed
Workload RightsizingThe Custom Owner Grouping defaultPolicy, if one matches the workload; otherwise the policy ScaleOps detects for it
GPU RightsizingThe Custom Owner Grouping defaultGpuPolicy, if one matches the workload; otherwise the system default GPU policy
GPU Memory Optimization (vLLM)The system default GPU memory policy
Replicas Optimization, Spot Optimization, Pod Scheduling OptimizationThe policy ScaleOps detects for the workload
DownscalerNo change: the workload keeps its current schedule

Automation annotations accept "true" or "false". Policy annotations take the name of an existing policy (or, for the Downscaler, a schedule), built-in or custom.

Annotation reference

Each product uses the same suffix in both the scaleops.sh/default- and scaleops.sh/force- forms. For example, rightsize-auto becomes scaleops.sh/default-rightsize-auto or scaleops.sh/force-rightsize-auto.

ProductAutomation suffixPolicy suffixPolicy value
Workload Rightsizingrightsize-autorightsize-policyRightsizing policy name
GPU Rightsizinggpu-autogpu-policyGPU policy name
GPU Memory Optimization (vLLM)vllm-autogpu-memory-policyGPU memory policy name
Java Recommendationjava-recommendation (default) / java-observability-auto (force)——
Java Optimizationjava-auto——
Replicas Optimizationreplicas-autoreplicas-policyReplicas policy name
Downscalerdownscaler-autodownscaler-scheduleDownscaler schedule name
Pod Scheduling Optimizationpod-scheduling-autopod-scheduling-policyPod scheduling policy name
Spot Optimizationspot-autospot-policySpot policy name

Version support:

  • Default annotations: Workload Rightsizing in all versions; every other product from v1.33.4.
  • Force automation annotations: from v1.34.15.
  • Force policy annotations: from v1.35.6.

Java Recommendation is the only product whose default and force annotations use different suffixes.

Automating a namespace using an annotation

Control namespace’s automation with annotation.

ℹ️

A UI action on a workload takes precedence over default annotations, and the annotation stops affecting that workload until you revert control.

Example:

apiVersion: v1 kind: Namespace metadata: annotations: scaleops.sh/default-rightsize-auto: "true" scaleops.sh/default-gpu-auto: "true" # (v1.33.4+) scaleops.sh/default-vllm-auto: "true" # (v1.33.4+) scaleops.sh/default-java-recommendation: "true" # (v1.33.4+) scaleops.sh/default-java-auto: "true" # (v1.33.4+) scaleops.sh/default-replicas-auto: "true" # (v1.33.4+) scaleops.sh/default-downscaler-auto: "true" # (v1.33.4+) scaleops.sh/default-pod-scheduling-auto: "true" # (v1.33.4+) scaleops.sh/default-spot-auto: "true" # (v1.33.4+)
ℹ️

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

ℹ️

The scaleops.sh/default-vllm-auto annotation only takes effect on workloads ScaleOps detects as vLLM workloads. See GPU Memory Optimization.

Setting namespace policy

Control namespace’s default policies with annotation.

ℹ️

A UI action on a workload takes precedence over default annotations, and the annotation stops affecting that workload until you revert control.

Example:

apiVersion: v1 kind: Namespace metadata: annotations: scaleops.sh/default-rightsize-policy: production scaleops.sh/default-gpu-policy: real-time # (v1.33.4+) scaleops.sh/default-gpu-memory-policy: vllm-memory-aware # (v1.33.4+) scaleops.sh/default-replicas-policy: production # (v1.33.4+) scaleops.sh/default-downscaler-schedule: nights # (v1.33.4+) scaleops.sh/default-pod-scheduling-policy: high-availability # (v1.33.4+) scaleops.sh/default-spot-policy: keep-original # (v1.33.4+)

Excluding namespace

Exclude namespace from automation by adding scaleops.sh/exclude-automation: "true" annotation.

ScaleOps will not allow automation on this excluded namespaces. If the namespace has automated workloads, adding the annotation will disable their automation.

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

ℹ️

Exclude annotation takes precedence over other annotations and UI actions.

Example:

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

Force annotations on a namespace

The force annotations can be set on a namespace and apply to every workload in it. A force annotation on the workload itself takes precedence over the namespace one, independently for automation and for policy, so a workload that sets its own value is not affected by a conflicting namespace value. See Force Override for the workload-level annotations.

Force automation

Use the scaleops.sh/force-<product>-auto annotations Available in v1.34.15+ to force automation for every workload in the namespace.

apiVersion: v1 kind: Namespace metadata: annotations: scaleops.sh/force-rightsize-auto: "true" scaleops.sh/force-gpu-auto: "true" scaleops.sh/force-vllm-auto: "true" scaleops.sh/force-java-observability-auto: "true" scaleops.sh/force-java-auto: "true" scaleops.sh/force-replicas-auto: "true" scaleops.sh/force-downscaler-auto: "true" scaleops.sh/force-pod-scheduling-auto: "true" scaleops.sh/force-spot-auto: "true"

Force policy

Use the scaleops.sh/force-<product>-policy annotations Available in v1.35.6+ to pin the policy of every workload in the namespace.

apiVersion: v1 kind: Namespace 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

Custom namespace labels
Available in v1.26.10+

ScaleOps enhances namespace management by enabling you to include or exclude namespaces from automation based on namespace labels. This allows workloads to remain visible for troubleshooting while controlling their automation status.

ℹ️

Unlike ignoredNamespaces in the Helm chart (which completely hides namespaces from ScaleOps), namespace automation settings allow workloads to remain visible in the platform while excluding them from automation.

Configuration can be done via:

  • Helm chart: Use the namespaceAutomation section in your values file. See Helm configuration reference.
  • Console UI: Navigate to Settings → General to select labels.
  • ConfigMap: Create the scaleops-custom-namespace-labels ConfigMap manually in the scaleops-system namespace.

Console UI for label-based namespace filtering

Configuration Options

FieldDescription
exclude-labelsExclude namespaces from automation by label. Format: "key=value" or "key=regex".
include-labelsInclude namespaces in automation by label. Format: "key=value" or "key=regex".

ConfigMap Example

apiVersion: v1 kind: ConfigMap metadata: name: scaleops-custom-namespace-labels namespace: scaleops-system data: exclude-labels: '["env=staging", "team=test-.*"]' include-labels: '["scaleops.sh/auto=true", "env=production"]'

Helm Values Example

namespaceAutomation: excludeLabels: - "env=staging" - "team=test-.*" # regex pattern for value includeLabels: - "scaleops.sh/auto=true" - "env=production"

Per-product namespace selectors

Use the productAutomation Helm value to include or exclude workloads from a single product based on the labels of their namespace, instead of all products. Each product accepts excludeNamespaceLabels and includeNamespaceLabels, in the same "key=value" / "key=regex" format as the fields above.

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. To select workloads by their own labels and annotations, see Per-product selectors.

# Helm values productAutomation: rightsize: # (v1.34.15+) includeNamespaceLabels: - "env=prod.*" excludeNamespaceLabels: - "env=staging" hpa: # (v1.34.15+) includeNamespaceLabels: - "purpose=hpa-testing" excludeNamespaceLabels: - "purpose=downscale-testing" spot: # (v1.34.15+) includeNamespaceLabels: - "env=dev" excludeNamespaceLabels: - "env=prod" gpu: # (v1.34.15+) includeNamespaceLabels: - "team=ml" excludeNamespaceLabels: - "team=web" vllm: # (v1.34.15+) includeNamespaceLabels: - "team=ml" excludeNamespaceLabels: - "team=web" java: # (v1.34.15+) includeNamespaceLabels: - "team=backend" excludeNamespaceLabels: - "env=prod" downscaler: # (v1.34.15+) includeNamespaceLabels: - "purpose=downscale-testing" excludeNamespaceLabels: - "env=prod" scheduleBlockers: # (v1.34.15+) includeNamespaceLabels: - "env=prod" excludeNamespaceLabels: - "env=dev" podPlacement: # exclude-only (v1.35.1+) excludeNamespaceLabels: - "env=prod"

Ignored Namespaces

Ignored namespaces are completely hidden from ScaleOps — workloads inside them are not displayed in the dashboard and not optimized in any way.

Configuration can be done via:

  • Console UI: Navigate to Settings → General under Namespace operations → Ignored Namespaces.
  • Helm chart: Use the ignoredNamespaces field in your values file. It accepts a list of namespace names or regex patterns. See Helm configuration reference.

Console UI for ignored namespaces

Default namespaces:

ignoredNamespaces: - kube-system - kube-public - kube-node-lease - "openshift.*" - trident - cluster-autoscaler

Example — adding custom ignored namespaces:

ignoredNamespaces: - kube-system - kube-public - kube-node-lease - "openshift.*" - trident - cluster-autoscaler - my-internal-namespace - "temp-.*"
⚠️

Setting ignoredNamespaces in your Helm values replaces the default list entirely. Make sure to include the default namespaces if you want to keep them ignored.

⚠️

Removing kube-system from ignored namespaces requires an additional Helm parameter alongside updating ignoredNamespaces. Without it, kube-system will remain ignored even if omitted from the list:

configParams: overrideUserKubeSystemIgnoredNamespace: "true"

Include both this parameter and your updated ignoredNamespaces list in the same Helm upgrade.

ℹ️

Ignored namespaces vs. automation exclusions: ignoredNamespaces completely hides namespaces from ScaleOps. If you want workloads to remain visible in the platform (for troubleshooting or monitoring) while excluding them from automation, use namespace automation settings or custom namespace labels instead.

ℹ️

Some features require the ScaleOps mutating webhook to intercept pods in the kube-system namespace, even if the namespace is ignored. Cloud provider consoles (e.g., GKE) may show warnings about this - these can be safely disregarded.

CRD

The AutomatedNamespace CRD allows you to automate an entire namespace or set a policy for all workloads within that namespace across all optimization products.

To apply this, create an AutomatedNamespace CR in the specific namespace you wish to automate or set a policy for.

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

  • Rightsizing: rightsizeOptimize: true/false, defaultRightsizePolicy: "policy-name"
  • GPU Rightsizing: gpuOptimize: true/false, defaultGpuPolicy: "policy-name"
  • GPU Memory Optimization: vllmOptimize: true/false, defaultGpuMemoryPolicy: "policy-name"
  • Java Recommendation: javaObservabilityEnabled: true/false Available in v1.33.4+
  • Java Optimization: javaOptimize: true/false
  • Replicas: replicasOptimize: true/false, defaultReplicasPolicy: "policy-name"
  • Spot: spotOptimize: true/false, defaultSpotPolicy: "policy-name"
  • Pod Scheduling: podSchedulingOptimize: true/false, defaultPodSchedulingPolicy: "policy-name"
  • Downscaler: downscalerOptimize: true/false, defaultDownscalerSchedule: "schedule-name"

By adding excludeAutomation field, you can exclude the entire namespace from automation.

Example - Configure namespace with ANS CRD:

apiVersion: analysis.scaleops.sh/v1alpha1 kind: AutomatedNamespace metadata: name: name-of-namespace # needs to match the name of the namespace namespace: name-of-namespace # needs to match the name of the namespace spec: rightsizeOptimize: true # enable or disable rightsize automation for all workloads in the namespace defaultRightsizePolicy: "production" gpuOptimize: true # enable or disable GPU rightsize automation for all workloads in the namespace defaultGpuPolicy: "real-time" vllmOptimize: true # enable or disable GPU memory automation for all workloads in the namespace defaultGpuMemoryPolicy: "vllm-memory-aware" javaObservabilityEnabled: true # enable or disable Java Recommendation (JVM observability) for all workloads in the namespace (v1.33.4+) javaOptimize: true # enable or disable Java optimization automation for all workloads in the namespace replicasOptimize: true # enable or disable replicas automation for all workloads in the namespace defaultReplicasPolicy: "cost" spotOptimize: true # enable or disable spot automation for all workloads in the namespace defaultSpotPolicy: "spot-friendly" podSchedulingOptimize: true # enable or disable pod scheduling automation for all workloads in the namespace defaultPodSchedulingPolicy: "high-availability" downscalerOptimize: true # enable or disable downscaler automation for all workloads in the namespace defaultDownscalerSchedule: "nights" excludeAutomation: false
ℹ️

UI actions take precedence over CRD automation and policy assignment actions, if taken after the CRD is applied. In addition, the workload exclude annotation will take precedence over the CRD action.

Note: The optimize field is supported to enable or disable automation for Workload Rightsizing for backward compatibility. The defaultPolicy field is supported to apply a specific policy to all workloads for Workload Rightsizing for backward compatibility.