Skip to main content

Workload Scope

The Workload Scope is the fifth scope available and holds configurations set at workload level. It overrides values already defined inside the Default Scope, ENV Scope, CLI Scope and Namespace Scope. It is the most specific scope available and its values can't be overridden by other scopes. It is only used to set values

Values

At the Workload Scope, the following values can be configured using annotations to apply scaling policies, exclusions and grace periods

warning

Some annotations are incompatible with others. You can check their compatibility by viewing the dedicated documentation page from the list above.

Usage

The workload annotations can be set either directly through the workload YAML file (e.g. kubectl edit command)

example-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
annotations:
downscaler/uptime: "Mon-Fri 08:00-20:00 UTC"
spec:
replicas: 3
selector:
matchLabels:
app: example-app
template:
metadata:
labels:
app: example-app
spec:
containers:
- name: example-app-container
image: nginx:latest

or by using the kubectl annotate command

kubectl annotate deployment example-deployment downscaler/uptime="Mon-Fri 08:00-20:00 UTC"