×

The autoscaler option can be configured to automatically scale the number of machines in a cluster.

The cluster autoscaler increases the size of the cluster when there are pods that failed to schedule on any of the current nodes due to insufficient resources or when another node is necessary to meet deployment needs. The cluster autoscaler does not increase the cluster resources beyond the limits that you specify.

Additionally, the cluster autoscaler decreases the size of the cluster when some nodes are consistently not needed for a significant period, such as when it has low resource use and all of its important pods can fit on other nodes.

When you enable autoscaling, you must also set a minimum and maximum number of worker nodes.

Only cluster owners and organization admins can scale or delete a cluster.

Enabling autoscaling nodes on a cluster

You can enable autoscaling on worker nodes to increase or decrease the number of nodes available by editing the machine pool definition for an existing cluster.

Enabling autoscaling nodes in an existing cluster using OCM

Enable autoscaling for worker nodes in the machine pool definition from the OCM console.

Procedure
  1. From the OCM console, navigate to the Clusters page and select the cluster that you want to enable autoscaling for.

  2. On the selected cluster, select the Machine pools tab.

  3. Click the Options menu kebab at the end of the machine pool that you want to enable autoscaling for and select Scale.

  4. On the Edit node count dialog, select the Enable autoscaling checkbox.

  5. Select Apply to save these changes and enable autoscaling for the cluster.

Additionally, you can configure autoscaling on the default machine pool when you create the cluster using interactive mode.

Enabling autoscaling nodes in an existing cluster using the rosa CLI

Configure autoscaling to dynamically scale the number of worker nodes up or down based on load.

Successful autoscaling is dependent on having the correct AWS resource quotas in your AWS account. Verify resource quotas and request quota increases from the AWS console.

Procedure
  1. To identify the machine pool IDs in a cluster, enter the following command:

    $ rosa list machinepools --cluster=<cluster_name>
    Example output
    ID        AUTOSCALING   REPLICAS    INSTANCE TYPE  LABELS    TINTS   AVAILABILITY ZONES
    default   No            2           m5.xlarge                        us-east-1a
    mp1       No            2           m5.xlarge                        us-east-1a
  2. Get the ID of the machine pools that you want to configure.

  3. To enable autoscaling on a machine pool, enter the following command:

    $ rosa edit machinepool --cluster=<cluster_name> <machinepool_ID> --enable-autoscaling --min-replicas=<number> --max-replicas=<number>
    Example

    Enable autoscaling on a machine pool with the ID mp1 on a cluster named mycluster, with the number of replicas set to scale between 2 and 5 worker nodes:

    $ rosa edit machinepool --cluster=mycluster mp1 --enable-autoscaling --min-replicas=2 --max-replicas=5

Disabling autoscaling nodes on a cluster

You can disable autoscaling on worker nodes to increase or decrease the number of nodes available by editing the machine pool definition for an existing cluster.

You can disable autoscaling on a cluster using OpenShift Cluster Manager (OCM) console or the Red Hat OpenShift Service on AWS CLI.

Additionally, you can configure autoscaling on the default machine pool when you create the cluster using interactive mode.

Disabling autoscaling nodes in an existing cluster using OCM

Disable autoscaling for worker nodes in the machine pool definition from the OCM console.

Procedure
  1. From the OCM console, navigate to the Clusters page and select the cluster with autoscaling that must be disabled.

  2. On the selected cluster, select the Machine pools tab.

  3. Click the Options menu kebab at the end of the machine pool with autoscaling and select Scale.

  4. On the "Edit node count" dialog, deselect the Enable autoscaling checkbox.

  5. Select Apply to save these changes and disable autoscaling from the cluster.

Disabling autoscaling nodes in an existing cluster using the rosa CLI

Disable autoscaling for worker nodes in the machine pool definition.

Procedure
  1. Enter the following command:

    $ rosa edit machinepool --cluster=<cluster_name> <machinepool_ID> --enable-autoscaling=false --replicas=<number>
    Example

    Disable autoscaling on the default machine pool on a cluster named mycluster:

    $ rosa edit machinepool --cluster=mycluster default --enable-autoscaling=false --replicas=3