Updating flavors (machine types)
Update the flavor (machine type) of your worker nodes when you need different compute resources, for example, more memory, additional CPUs, or a GPU-enabled machine. Updating a flavor provisions a new worker pool with the new flavor and then removes the old worker pool. Because this process replaces nodes, all data on the worker nodes that is not stored on persistent storage is permanently deleted.
Before you begin
- Access your Red Hat OpenShift cluster.
- Verify that any data you need to retain is stored on persistent storage outside the worker node. Data stored only on the worker node is lost and cannot be recovered.
- Make sure that you have the Operator or Administrator IAM platform access role. If you're unsure of your access role, go to Manage > Access (IAM) > Users in the IBM Cloud console, or ask your account administrator.
Updating the flavor
-
List available worker nodes and note their private IP address.
- List available worker pools in your cluster.
ibmcloud oc worker-pool ls --cluster CLUSTER - List the worker nodes in the worker pool. Note the ID and Private IP.
ibmcloud oc worker ls --cluster CLUSTER --worker-pool WORKER-POOL - Get the details for a worker node. In the output, note the zone and either the private and public VLAN ID for classic clusters or the subnet ID for VPC clusters.
ibmcloud oc worker get --cluster CLUSTER --worker WORKER-ID
- List available worker pools in your cluster.
-
List available flavors in the zone.
ibmcloud oc flavors --zone ZONE -
Create a worker node with the new machine type.
- Create a worker pool with the number of worker nodes that you want to replace.
- Classic clusters:
ibmcloud oc worker-pool create classic --name WORKER-POOL --cluster CLUSTER --flavor FLAVOR --size-per-zone NUMBER-OF-WORKERS-PER-ZONE - VPC Generation 2 clusters:
ibmcloud oc worker-pool create vpc-gen2 --name NAME --cluster CLUSTER --flavor FLAVOR --size-per-zone NUMBER-OF-WORKERS-PER-ZONE --label LABEL
- Classic clusters:
- Verify that the worker pool is created.
ibmcloud oc worker-pool ls --cluster CLUSTER - Add the zone to your worker pool that you retrieved earlier. When you add a zone, the worker nodes that are defined in your worker pool are provisioned in the zone and considered for future workload scheduling. If you want to spread your
worker nodes across multiple zones, choose a classic or VPC multizone location.
- Classic clusters:
ibmcloud oc zone add classic --zone ZONE --cluster CLUSTER --worker-pool WORKER-POOL --private-vlan PRIVATE-VLAN-ID --public-vlan PUBLIC-VLAN-ID - VPC clusters:
ibmcloud oc zone add vpc-gen2 --zone ZONE --cluster CLUSTER --worker-pool WORKER-POOL --subnet-id VPC-SUBNET-ID
- Classic clusters:
- Create a worker pool with the number of worker nodes that you want to replace.
-
Wait for the worker nodes to be deployed. When the worker node state changes to Normal, the deployment is finished.
ibmcloud oc worker ls --cluster CLUSTER -
Remove the old worker pool. If you are removing a Classic bare metal flavor (which is billed monthly), you are charged for the entire month even if you remove it mid-month. VPC workers, including bare metal, are billed hourly.
- Remove the worker pool with the old machine type. Removing a worker pool removes all worker nodes in the pool in all zones. This process might take a few minutes to complete.
ibmcloud oc worker-pool rm --worker-pool WORKER-POOL --cluster CLUSTER - Verify that the worker pool is removed.
ibmcloud oc worker-pool ls --cluster CLUSTER
- Remove the worker pool with the old machine type. Removing a worker pool removes all worker nodes in the pool in all zones. This process might take a few minutes to complete.
-
Verify that the worker nodes are removed from your cluster.
ibmcloud oc worker ls --cluster CLUSTER -
Repeat these steps to update other worker pools or stand-alone worker nodes to different flavors.
Next steps
Learn how worker pools are scaled down when worker nodes are removed. To keep your worker nodes current, see Updating clusters, worker nodes, and cluster components.