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
  • works for components: KubeDownscaler (you can still specify this argument inside the Webhook but types configured inside the MutatingWebhookConfiguration takes precedence)

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

QPS

  • Type: float64
  • Description: Sets the maximum number of queries per second (QPS) that the downscaler can make to the Kubernetes API server. If you set QPS to a negative value rate limiting will be disabled even if you specify a Burst value. Kubernets Documentation and
  • Default: 500
  • Where to set: CLI Scope

Burst

  • Type: int
  • Description: Sets the maximum burst rate the downscaler can use when throttling requests to the Kubernetes API server. Burst must be greater than 0, and it is only effective if QPS is set to a non-negative value. It is strongly recommended to set Burst to a value greater than QPS to allow for occasional spikes in request rates. Kubernets Documentation and
  • Default: 1000
  • 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
  • Only works for component: KubeDownscaler

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
  • Only works for component: KubeDownscaler
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.

Json Logs

  • Type: boolean
  • Description: Sets the log output format to JSON for easier parsing and integration with log management systems.
  • Default: false
  • Where to set: CLI Scope

Metrics

  • Type: boolean
  • Description: Enables the Prometheus metrics endpoint. To see the list of available metrics, check the dedicated Metrics Documentation.
  • Default: false
  • Where to set: CLI Scope

Internal Cert Rotation

  • Type: boolean
  • Description: Enables automatic rotation of the TLS certificates used by the webhook server.
  • Default: false
  • Where to set: CLI Scope
  • Only works for component: Webhook

Webhook Service Name

  • Type: string
  • Description: Sets the name of the Kubernetes Service that exposes the webhook server. It is needed to ensure the correct functioning of the webhook when internal certificate rotation is enabled.
  • Default: gokube-downscaler-webhook
  • Where to set: CLI Scope
  • Only works for component: Webhook

Cluster Domain

  • Type: string
  • Description: Sets the cluster domain used to construct the webhook service URL. It is needed to ensure the correct functioning of the webhook when internal certificate rotation is enabled.
  • Default: cluster.local
  • Where to set: CLI Scope
  • Only works for component: Webhook

TLS Secret Name

  • Type: string
  • Description: Sets the name of the Kubernetes Secret that contains the TLS certificates for the webhook server. It is needed to ensure the correct functioning of the webhook when internal certificate rotation is enabled.
  • Default: gokube-downscaler-webhook
  • Where to set: CLI Scope
  • Only works for component: Webhook

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