Scaling Worker Node Count in Azure Red Hat OpenShift (ARO)
This guide explains how to change the number of worker nodes in an ARO cluster by modifying the MachineSet replica count.
WARNING
You cannot scale worker nodes through Terraform or the Azure CLI. The azurerm_redhat_openshift_cluster Terraform resource treats the worker profile as a create-time property. Changing the node count forces a full cluster replacement. There is also no az aro CLI command to adjust the worker count after deployment. The only supported method is scaling the MachineSet resources directly through the OpenShift API.
How It Works
ARO creates one MachineSet per availability zone. A standard ARO deployment has a minimum of 3 availability zones, so you'll see at least 3 MachineSet resources. Each MachineSet controls the number of worker nodes in its respective AZ. To scale the cluster, you adjust the replica count on the MachineSet for the target availability zone.
Prerequisites
- Access to the ARO cluster with cluster-admin privileges
- The
ocCLI tool installed and configured
Scale Worker Nodes
1. Switch to the machine API namespace
oc project openshift-machine-api2. List the available machinesets
oc get machinesetExample output:
NAME DESIRED CURRENT READY AVAILABLE AGE
aro-cluster-worker-westeurope1 1 1 1 1 30d
aro-cluster-worker-westeurope2 1 1 1 1 30d
aro-cluster-worker-westeurope3 1 1 1 1 30dEach MachineSet corresponds to an availability zone. The DESIRED column shows the current replica count for that zone.
3. Scale the machineset
Use oc scale to change the replica count for the target MachineSet:
oc scale machineset <machineset-name> --replicas=<count>For example, to scale the first AZ from 1 to 3 workers:
oc scale machineset aro-cluster-worker-westeurope1 --replicas=3You can also scale multiple zones at once if you want an even distribution:
oc scale machineset aro-cluster-worker-westeurope1 --replicas=2
oc scale machineset aro-cluster-worker-westeurope2 --replicas=2
oc scale machineset aro-cluster-worker-westeurope3 --replicas=2TIP
Distribute replicas evenly across availability zones for better fault tolerance. If you need 6 workers total, run 2 per zone rather than putting all 6 in a single zone.
4. Verify the new nodes
Monitor the machines being provisioned:
oc get machines -wOnce the machines are provisioned, verify the nodes have joined and are ready:
oc get nodes -l node-role.kubernetes.io/workerScaling Down
The same command works for scaling down. When you reduce the replica count, the MachineSet controller will automatically select a machine to delete, drain its workloads, and remove the node from the cluster.
oc scale machineset aro-cluster-worker-westeurope1 --replicas=1IMPORTANT
Make sure you have enough capacity in the remaining nodes to handle the workloads before scaling down. Pods with PodDisruptionBudgets or node affinity rules may prevent a clean drain.
Troubleshooting
Check machineset status:
oc get machineset <machineset-name> -o yamlView machine events:
oc describe machine <machine-name>Check machine controller logs:
oc logs -n openshift-machine-api deployment/machine-api-controllers -c machine-controller