Skip to main content

Runtime Configuration

Runtime Configurations change how the Downscaler operates. controlling aspects like which namespaces and workload types it should target, frequency of scans, retries, whether debugging information is enabled and more. Runtime Configurations do not dictate how and when individual workloads are scaled.

List Of Runtime Configurations

Here is a list of all the available runtime configurations for the Downscaler.

Dry Run

  • Type: boolean
  • Description: Makes the downscaler print the changes it would have made instead of applying them. Will additionally enable Debug.
  • Default: false
  • Where to set: CLI Scope

Debug

  • Type: boolean
  • Description: Will print additional debug information.
  • Default: false
  • Where to set: CLI Scope

Once

  • Type: boolean
  • Description: Makes the Downscaler only scan once before exiting.
  • Default: false
  • Where to set: CLI Scope

Interval

  • Type: Duration
  • Description: Sets the time the Downscaler waits between scans.
  • Default: 30s
  • Where to set: CLI Scope

Namespace

  • Type: String List (list of namespace names)
  • Description: Sets the namespaces the Downscaler will scan over (restricts the 'cluster-wide' scopes to specific namespaces).
  • Default: All Namespaces
  • Where to set: CLI Scope

Include Resources

  • Type: String List (list of workload types)
  • Description: Sets the resources/workload types the downscaler will scan over (restricts the 'cluster-wide' scopes to specific types).
  • Default: deployments
  • Where to set: CLI Scope

Exclude Namespaces

  • Type: Regex List (list of regex patterns matching namespace names)
  • Description: Makes the downscaler exclude workloads within matching namespaces (restricts the 'cluster-wide' scopes to exclude specific namespaces).
  • Default: kube-system, kube-downscaler
  • Where to set: CLI Scope, ENV Scope

Exclude Deployments

  • Type: Regex List (list of regex patterns matching workload names)
  • Description: Makes the downscaler exclude workloads with matching names (restricts the 'cluster-wide' scopes to exclude matching workloads).
  • Default: none
  • Where to set: CLI Scope, ENV Scope

Matching Labels

  • Type: Regex List (list of regex patterns matching labels)

    info

    The Pattern has to match this pattern: LABEL_NAME=LABEL_VALUE. This means that to match the example label to be "true" you would put in example=true. To match a workload having the label no matter the value you would use example=.*.

  • Description: Makes the downscaler only scale workloads whose labels match at least one of the patterns (restricts the 'cluster-wide' scopes to matching workloads).

  • Default: none (the workloads don't have to match any label)

  • Where to set: CLI Scope

Time Annotation

  • Type: string (annotation on workload containing an RFC3339 formatted timestamp)
  • Description: Makes the downscaler check the grace period against the value of the annotation instead of the creation time of the workload.
  • Default: none (the downscaler will use the creation time of the workload)
  • Where to set: CLI Scope

Leader Election

  • Type: boolean
  • Description: Enforces leader election by creating lease objects to ensure only one instance of the GoKubeDownscaler is active at any given time to avoid conflicts.
  • Default: false
  • Where to set: CLI Scope

Max Retries on Conflict

  • Type: integer
  • Description: Sets the maximum number of retries for handling HTTP 409 conflict errors, which occur when another entity modifies a resource that the downscaler is currently processing.
  • Default: 0
  • Where to set: CLI Scope
tip

We recommend setting this to a value greater than 0 when once is enabled. Since, in that case, the downscaler will only run once, you might want to perform retries if such conflicts occurs.

Kubeconfig

  • Type: string (path to a kubeconfig file)
  • Description: Makes the downscaler use the local kubeconfig instead of using the in-cluster config. It will use the current-context specified in the kubeconfig. The token/account used by the kubeconfig needs to have the permissions necessary for scaling.
  • Default: none (the downscaler will use the in-cluster config)
  • Where to set: CLI Scope