$ rosa list machinepools --cluster=<cluster_name>
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. |
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.
Enable autoscaling for worker nodes in the machine pool definition from OpenShift Cluster Manager console.
From OpenShift Cluster Manager, navigate to the Cluster List page and select the cluster that you want to enable autoscaling for.
On the selected cluster, select the Machine pools tab.
click the Options menu at the end of the machine pool that you want to enable autoscaling for and select Edit.
On the Edit machine pool dialog, select the Enable autoscaling checkbox.
Select Save to save these changes and enable autoscaling for the machine pool.
Additionally, you can configure autoscaling on the default machine pool when you create the cluster using interactive mode. |
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.
To identify the machine pool IDs in a cluster, enter the following command:
$ rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SUBNETS SPOT INSTANCES DISK SIZE SG IDs
worker No 2 m5.xlarge us-east-2a No 300 GiB
mp1 No 2 m5.xlarge us-east-2a No 300 GiB
Get the ID of the machine pools that you want to configure.
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>
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
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 Red Hat OpenShift Cluster Manager 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. |
Disable autoscaling for worker nodes in the machine pool definition from OpenShift Cluster Manager.
From OpenShift Cluster Manager, navigate to the Cluster List page and select the cluster with autoscaling that must be disabled.
On the selected cluster, select the Machine pools tab.
click the Options menu at the end of the machine pool with autoscaling and select Edit.
On the Edit machine pool dialog, deselect the Enable autoscaling checkbox.
Select Save to save these changes and disable autoscaling from the machine pool.
Disable autoscaling for worker nodes in the machine pool definition using the Red Hat OpenShift Service on AWS (ROSA) cli, rosa
.
Enter the following command:
$ rosa edit machinepool --cluster=<cluster_name> <machinepool_ID> --enable-autoscaling=false --replicas=<number>
Disable autoscaling on the default
machine pool on a cluster named mycluster
:
$ rosa edit machinepool --cluster=mycluster default --enable-autoscaling=false --replicas=3