Skip to main content
Skip table of contents

vSphere Cluster Autoscaler

Cluster Autoscaler

Cluster Autoscaler provides the ability to automatically scale-up or scale-down the number of worker nodes in a cluster, based on the number of pending pods to be scheduled. Running the Cluster Autoscaler is optional.

Unlike Horizontal-Pod Autoscaler, Cluster Autoscaler does not depend on any Metrics server and does not need Prometheus or any other metrics source.

The Cluster Autoscaler looks at the following annotations on a MachineDeployment to determine its scale-up and scale-down ranges:


The full list of command line arguments to the Cluster Autoscaler controller is found this topic.

For more information about how Cluster Autoscaler works, see these documents:

Cluster Autoscaler Prerequisites

Before you begin, you must have:

Run Cluster Autoscaler

The Cluster Autoscaler controller runs on the workload cluster. Upon creation of the workload cluster, this controller does not have all the objects required to function correctly until after a dkp move is issued from the bootstrap cluster.

Run the following steps to enable Cluster Autoscaler:

  1. Ensure the Cluster Autoscaler controller is up and running (no restarts and no errors in the logs)

    kubectl --kubeconfig=${CLUSTER_NAME}.conf logs deployments/cluster-autoscaler cluster-autoscaler -n kube-system -f

  2. Enable Cluster Autoscaler by setting the min & max ranges

    kubectl --kubeconfig=${CLUSTER_NAME}.conf annotate machinedeployment ${NODEPOOL_NAME}
    kubectl --kubeconfig=${CLUSTER_NAME}.conf annotate machinedeployment ${NODEPOOL_NAME}

  3. The Cluster Autoscaler logs will show that the worker nodes are associated with node-groups and that pending pods are being watched.

  4. To demonstrate that it is working properly, create a large deployment which will trigger pending pods.

    cat <<EOF | kubectl --kubeconfig=${CLUSTER_NAME}.conf apply -f -
    apiVersion: apps/v1
    kind: Deployment
      name: busybox-deployment
        app: busybox
      replicas: 600
          app: busybox
            app: busybox
          - name: busybox
            image: busybox:latest
              - sleep
              - "3600"
            imagePullPolicy: IfNotPresent
          restartPolicy: Always

    Cluster Autoscaler scales up the number of Worker Nodes until there are no pending pods.

  5. Scale down the number of replicas for busybox-deployment with the command:

    kubectl --kubeconfig ${CLUSTER_NAME}.conf scale --replicas=30 deployment/busybox-deployment

  6. Cluster Autoscaler starts to scale down the number of Worker Nodes after the default timeout of 10 minutes.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.