
// Module included in the following assemblies:
//
// * rosa_cluster_admin/rosa_nodes/rosa-nodes-about-autoscaling-nodes.adoc
// * nodes/nodes-about-autoscaling-nodes.adoc

:_mod-docs-content-type: PROCEDURE
[id="rosa-enabling-autoscaling-nodes_{context}"]
= 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 link:https://aws.amazon.com/console/[AWS console].

.Procedure

. To identify the machine pool IDs in a cluster, enter the following command:
+
[source,terminal]
----
$ rosa list machinepools --cluster=<cluster_name>
----
+
.Example output
ifndef::openshift-rosa-hcp[]
[source,terminal]
----
ID      AUTOSCALING  REPLICAS  INSTANCE TYPE  LABELS    TAINTS    AVAILABILITY ZONES    SUBNETS    SPOT INSTANCES  DISK SIZE  SG IDs
worker  No           2         m7i.xlarge                          us-east-2a                       No              300 GiB
mp1     No           2         m7i.xlarge                          us-east-2a                       No              300 GiB  
----
endif::openshift-rosa-hcp[]
ifdef::openshift-rosa-hcp[]
[source,terminal]
----
ID       AUTOSCALING  REPLICAS  INSTANCE TYPE  LABELS    TAINTS    AVAILABILITY ZONE  SUBNET                    VERSION  AUTOREPAIR  
workers  No           2/2       m7i.xlarge                          us-east-2a         subnet-03c2998b482bf3b20  4.16.6   Yes
mp1      No           2/2       m7i.xlarge                          us-east-2a         subnet-03c2998b482bf3b20  4.16.6   Yes
----
endif::openshift-rosa-hcp[]

. Get the ID of the machine pools that you want to configure.

. To enable autoscaling on a machine pool, enter the following command:
+
[source,terminal]
----
$ 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:
+
[source,terminal]
----
$ rosa edit machinepool --cluster=mycluster mp1 --enable-autoscaling --min-replicas=2 --max-replicas=5
----
