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

Updating the flavor

  1. List available worker nodes and note their private IP address.

    1. List available worker pools in your cluster.
      ibmcloud ks worker-pool ls --cluster CLUSTER
      
    2. List the worker nodes in the worker pool. Note the ID and Private IP.
      ibmcloud ks worker ls --cluster CLUSTER --worker-pool WORKER-POOL
      
    3. 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 ks worker get --cluster CLUSTER --worker WORKER-ID
      
  2. List available flavors in the zone.

    ibmcloud ks flavors --zone ZONE
    
  3. Create a worker node with the new machine type.

    1. Create a worker pool with the number of worker nodes that you want to replace.
      • Classic clusters:
        ibmcloud ks worker-pool create classic --name WORKER-POOL --cluster CLUSTER --flavor FLAVOR --size-per-zone NUMBER-OF-WORKERS-PER-ZONE
        
      • VPC Generation 2 clusters:
        ibmcloud ks worker-pool create vpc-gen2 --name NAME --cluster CLUSTER --flavor FLAVOR --size-per-zone NUMBER-OF-WORKERS-PER-ZONE --label LABEL
        
    2. Verify that the worker pool is created.
      ibmcloud ks worker-pool ls --cluster CLUSTER
      
    3. 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 ks zone add classic --zone ZONE --cluster CLUSTER --worker-pool WORKER-POOL --private-vlan PRIVATE-VLAN-ID --public-vlan PUBLIC-VLAN-ID
        
      • VPC clusters:
        ibmcloud ks zone add vpc-gen2 --zone ZONE --cluster CLUSTER --worker-pool WORKER-POOL --subnet-id VPC-SUBNET-ID
        
  4. Wait for the worker nodes to be deployed. When the worker node state changes to Normal, the deployment is finished.

    ibmcloud ks worker ls --cluster CLUSTER
    
  5. 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.

    1. 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 ks worker-pool rm --worker-pool WORKER-POOL --cluster CLUSTER
      
    2. Verify that the worker pool is removed.
      ibmcloud ks worker-pool ls --cluster CLUSTER
      
  6. Verify that the worker nodes are removed from your cluster.

    ibmcloud ks worker ls --cluster CLUSTER
    
  7. 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.