Skip to content

EMK - Cluster Autoscaler

Estimated time to read: 2 minutes

This page describes how to configure Cluster Autoscaler for your Kubernetes cluster with custom settings. This is only available through the YAML configurator.

Autoscaling automatically adjusts your resources up or down to match changing demands. This key Kubernetes feature saves significant effort by eliminating the need for manual scaling. The Cluster Autoscaler respects the limits (min / max) of any worker pool in a cluster spec. It can also scale down nodes based on utilization thresholds. For more details, see the autoscaler documentation or available settings.

K8s pod autoscaling

Source: Gardener documentation

Configure Cluster Autoscaler

To configure Cluster Autoscaler, update your Kubernetes cluster configuration.

For example set the Cluster Autoscaler setting maxEmptyBulkDelete (default 10), to 2 with:

spec:
  kubernetes:
    clusterAutoscaler:
      maxEmptyBulkDelete: 2

Configure Cluster Autoscaler worker pool settings over at the worker pool settings in your kubernetes specification with:

spec:
  provider:
    workers:
    - name: worker-pool-1
      clusterAutoscaler:
        scaleDownUtilizationThreshold: 0.5
        scaleDownGpuUtilizationThreshold: 0.5
        scaleDownUnneededTime: 30m
        scaleDownUnreadyTime: 1h
        maxNodeProvisionTime: 15m

Cluster Autoscaler status

The Cluster Autoscaler publishes a configMap resource called cluster-autoscaler-status in namespace kube-system containing the state of Cluster Autoscaler and its node groups (created by Gardener based on worker pools). Run the following command to view the current status:

kubectl get configmap cluster-autoscaler-status -n kube-system -o yaml