Values
Values define the scaling behavior of targeted workloads, specifying how and when they should be scaled up or down. They can be set at any scope and therefore can be set via their respective environment variables, cli arguments, namespace annotations and workload annotations
The default values shown below are only set on the default scope.
Order
Some of the values have a specific order in which they are evaluated. This means that some values take precedence over others.
Exclusion
Exclusion contains all values which exclude the workload (e.g. Exclude, Exclude Until, Grace Period).
If any of these values exclude the workload, it will not be scaled.
Scaling
Scaling includes all values which influence the state of Scaling the workload should be in (e.g. Force Downtime, Force Uptime, Downscale Period, Downtime, Upscale Period, Uptime).
If Force Downtime or Force Uptime is true/matching during scaling their respective scaling will be used. Otherwise the Downscale Period, Downtime, Upscale Period and Uptime values are evaluated.
Currently if Downscale Period and Upscale Period or Force Downtime and Force Uptime is set, and both of either match the same time the workload will result in an error during scaling, basically skipping scaling on the workload. This is NOT final intended behavior and you should not rely on this. This might change in the future to be seen as an parsing incompatibility instead of an runtime one. If this gets changed this would result in misconfigured workloads to not being scaled at all, instead erroring during scaling.
Value Groups
Some values within a scope set/define very similar properties (e.g. Force Downtime and Force Uptime; Downscale Period, Downtime, Upscale Period and Uptime)
These values are not all handled separately when choosing which scope to take the values from. Instead if one of them is set in a scope, the other values will be taken from the same scope.
Incompatibilities between values normally only occur between values in the same value group and therefore the values on that same scope.
Below is a diagram showing the process of a value group being evaluated.
Rows where the action is:
- × are not taken into account
- « is the row the value was taken from
- ↑ are empty and are not taken into account
Force Uptime | Force Downtime | Action | |
---|---|---|---|
Default | - | - | × |
Environment | false | true | × |
CLI | - | false | × |
Namespace | true | - | « (any set) |
Workload | - | - | ↑ (none set) |
Result | true | - |
List Of Values
Here is a list of all values that can be set on the Downscaler.
Downscale Period
- Type: Timespans
- Default: unset (never matches)
- Within these periods the workload will be scaled down. Outside of the periods, scaling will be ignored/overwritten by Upscale Period.
- Can be paired with upscale period
- Incompatible with Downtime and Uptime
- Grouped with downtime, uptime and upscale period
- Where to set: ENV Scope, Namespace Scope, Workload Scope
Downtime
- Type: Timespans
- Default: unset (never matches)
- Within these periods the workload will be scaled down. Outside of the periods the workload will be scaled up.
- Incompatible with downscale period, upscale period and Uptime
- Grouped with downscale period, uptime and upscale period
- Where to set: ENV Scope, Namespace Scope, Workload Scope
Upscale Period
- Type: Timespans
- Default: unset (never matches)
- Within these periods the workload will be scaled up. Outside of the periods, scaling will be ignored/overwritten by Downscale Period.
- Can be paired with downscale period
- Incompatible with Downtime and Uptime
- Grouped with downscale period, uptime and Downtime
- Where to set: ENV Scope, Namespace Scope, Workload Scope
Uptime
- Type: Timespans
- Default: unset (never matches)
- Within these periods the workload will be scaled up. Outside of the periods the workload will be scaled down.
- Incompatible with downscale period, upscale period and Downtime
- Grouped with downscale period, upscale period and Downtime
- Where to set: ENV Scope, Namespace Scope, Workload Scope
Exclude
- Type: Timespans (this also includes true/false)
- Default: unset (never matches)
- Excludes the workload from being scaled. (Scaling is ignored)
- Where to set: Namespace Scope, Workload Scope
Exclude Until
- Type: RFC3339 timestamp
- Default: unset
- Excludes the workload from being scaled until the set time. (Scaling is ignored)
- Where to set: Namespace Scope, Workload Scope
Force Uptime
- Type: Timespans (this also includes true/false)
- Default: unset (never matches)
- Forces the workload into an uptime state. (Scaling up)
- Grouped with force downtime
- Where to set: CLI Scope, Namespace Scope, Workload Scope
Force Downtime
- Type: Timespans (this also includes true/false)
- Default: unset (never matches)
- Forces the workload into a downtime state. (Scaling down)
- Grouped with force uptime
- Where to set: CLI Scope, Namespace Scope, Workload Scope
Downscale Replicas
- Type: Replicas
- Default: 0
- The Replica count the workload will be scaled to during downtimes.
- Where to set: CLI Scope, Namespace Scope, Workload Scope
Grace Period
- Type: Duration
- Default: 15 minutes
- The Duration a workload has to exist for until being scaled the first time. Will check against the timestamp in the time annotation instead of the creation time when set.
- Where to set: CLI Scope, Namespace Scope, Workload Scope
Scale Children
- Type: boolean
- Description: Enables the downscaler to immediately scale child resources of the targeted workload.
By default, only the main workload is scaled, which may leave child resources, such as Jobs created by a
CronJob, running to completion if the child kind is not included inside the
included-resource
argument - Default: false
- Where to set: CLI Scope, Namespace Scope, Workload Scope
Incompatibilities
Parsing Incompatibility
Parsing incompatibilities covers most of the downscalers incompatibilities.
This currently includes the Incompatible with
field shown above,
which marks the incompatibility of two values being set in the same scope.
These incompatibilities are easy to catch, since they get shown every scan.
Runtime Incompatibility
These are incompatibilities we at least currently cannot check for during parsing. This currently only affects timespan values that have the same order/priority within the scope and are setting different scaling states when matching like Downscale Period and Upscale Period or Force Downtime and Force Uptime.
We have strongly tried to make these incompatibilities not cause unexpected behavior, opting for just printing an error and ignoring the workload that scan cycle.
What can't be changed is that these will be hard to notice and find the cause for, since depending on the configuration causing this and the scan interval it could happen that this configuration error only shows up every few years.
Avoiding these should be relatively simple, by reading the documentation and making sure not to overlap timespans between values like Downscale Period and Upscale Period.