Skip to main content
Version: 1.3.0

On Demand Startup

One of the most effective patterns for using the GoKubeDownscaler is to keep workloads always scaled down. Scale up will be performed on demand using annotations. This is an advanced pattern that can be used to achieve the maximum cost savings.

For this use case we will use boolean timespans

The global configuration for this use case is typically defined manually by cluster administrators. In contrast, workload- or namespace-level configuration is usually applied through annotations, often managed by external automations running in CI/CD pipelines or behind the internal software catalog exposed to developers to interact with the internal development platform.

Cluster-Wide

The first step is to set up the cluster-wide downtime.

This can be done by either using an environment variable or a cli argument for the GoKubeDownscaler.

Important

In this scenario it is strongly recommended to exclude by default all critical namespaces that are needed for the cluster to function properly even when non-essential namespaces are scaled down.

To set a cluster-wide downtime with environment variables you can add them inside the values.yaml file.

There you have to add it to the configMap.extraConfig field:

values.yaml
# ...

configMap:
name: go-kube-downscaler
# remember to exclude all critical namespaces
extraConfig: |
DEFAULT_DOWNTIME: "always"
EXCLUDE_NAMESPACES: "kube-system,istio-system,karpenter,prometheus"
# ...

After setting the variable in one of the two ways, all non-essential namespaces will be scaled down at all times.

Namespace Level

At this point external automations (or manual interventions by cluster administrators) scale up namespaces upon user request by adding an exclude annotation to the namespace.

kubectl annotate namespace my-namespace downscaler/exclude="true"

Scale down can be performed by external automations by removing the annotation after a fixed amount of time or by user request. Alternatively, it is possible to use the downscaler/exclude-until annotation that constrains the exclusion until a specific time.

kubectl annotate namespace my-namespace downscaler/exclude-until="2025-12-22T00:00:00+01:00"

info

For more information about the scaling algorithm check out the scope documentation. You will find a detailed explanation of how the GoKubeDownscaler evaluates the downtime and decides when to scale down or up workloads.