$ rosa list machinepools --cluster=<cluster_name>
This section describes how to manage worker nodes with Red Hat OpenShift Service on AWS (ROSA).
The majority of changes for worker nodes are configured on machine pools. A machine pool is a group of worker nodes in a cluster that have the same configuration, providing ease of management. You can edit the configuration of worker nodes for options such as scaling, instance type, labels, and taints.
Worker nodes can be scaled manually if you do not want to configure node autoscaling.
To get a list of the machine pools in a cluster, enter the following command. Each cluster has a default machine pool that is created when you create a cluster.
$ rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES
default No 2 m5.xlarge us-east-1a
mp1 No 2 m5.xlarge us-east-1a
Review the output from the rosa list machinepools
command to find the ID of the machine pool you want to scale and see the current number of replicas.
To change the scale, enter the following command and increase or decrease the number of replicas:
$ rosa edit machinepool --cluster=<cluster_name> --replicas=<number_worker_nodes> <machinepool_ID>
To verify that the change has taken effect, enter the following command:
$ rosa describe cluster --cluster=<cluster_name>
The response output shows the number of worker nodes, or replicas, as Compute
nodes.
Optional: To view this change in the OCM console:
Select the cluster.
From the Overview tab, in the Details
pane, review the Compute
node number.
Add or edit labels for worker nodes at any time to manage the nodes in a manner that is relevant to you. For example, you can assign types of workloads to specific nodes.
Labels are assigned as key=value pairs. Each key must be unique to the object it is assigned to. Labels do not change or impact the core system values, such as a machine pool ID.
To create a new machine pool, add the node labels, and create replica worker nodes, enter the following command:
$ rosa create machinepool --cluster=<cluster-name> <machinepool_ID> --replicas=<number-nodes> --labels=<key=pair>
This example shows how to use labels to assign a database workload to a group of worker nodes, and creates 2 replica worker nodes that you can manage as one unit:
$ rosa create machinepool --cluster=mycluster db-nodes-mp --replicas=2 --labels=app=db,tier=backend
I: Machine pool 'db-nodes-mp' created successfully on cluster 'mycluster'
To verify that the machine pool, labels, and replicas were created, enter the following command:
$ rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES
default No 2 m5.xlarge us-east-1a
db-nodes-mp No 2 m5.xlarge app=db, tier=backend us-east-1a
After a machine pool is created, the instance type cannot be changed. To add a different instance type for worker nodes, you must create a new machine pool for the additional instance type.
To add an instance type with a new machine pool, enter the following command:
$ rosa create machinepool --cluster=<cluster-name> <machinepool_ID> --instance-type=<type>
This example creates a new machine pool with the instance type m5.2x.large
, 2 replicas, and labels on a cluster named mycluster
:
$ rosa create machinepool --cluster=mycluster db-nodes-large-mp --replicas=2 --labels=app=db,tier=backend --instance-type=m5.2xlarge
For a complete list of supported instance types, see the Policies and Service Definition. |
To verify that the machine pool was created with the instance type, enter the following command:
$ rosa list machinepools --cluster=<cluster_name>
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES
default No 2 m5.xlarge us-east-1a
db-nodes-mp No 2 m5.xlarge app=db, tier=backend us-east-1a
db-nodes-large-mp No 2 m5.2xlarge app=db, tier=backend us-east-1a