Assigning hosts with host label auto assignment
Hosts are automatically assigned to worker pools in clusters or Satellite-enabled IBM Cloud services using host labels to match available compute capacity. You can enable or disable auto assignment.
Host auto assignment is not available for the Satellite location control plane.
Host labels
Host auto assignment matches worker pool labels in Satellite clusters to host and zone labels on available hosts.
Keep in mind the following information about the host labels that are used for auto assignment.
- Default host labels
- When you attach a host to a Satellite location, the host automatically gets labels for
cpu,os, andmemory(in bytes). You cannot remove these labels. You can include additional host labels, or update the host metadata later. If the host does not include theoslabel, it is automatically assumed asRHEL7. - Hosts can have more labels than worker pools
- For example, a host with
cpu,memory, andenvhost labels can be auto-assigned to a worker pool that has only acpuhost label. Host auto assignment matches thecpulabels. The reverse does not work: if a worker pool has more labels than a host, the host cannot be auto assigned to the worker pool. - Matching is exact
- Host labels must equal (
=) each other exactly. Even if the host label is a number, no less than (<), greater than (>), or other operators are used for matching.
Example scenario for host auto assignment
Say that you have a Satellite cluster with a default worker pool in us-east-1a and the following host labels.
cpu=4env=prodos=RHEL7
Your Satellite location has available (unassigned) hosts with host labels as follows.
- Host A:
cpu=4, memory=32, env=prod, zone=us-east-1bos=rhel - Host B:
cpu=4, memory=32, zone=us-east-1aos=RHEL7 - Host C:
cpu=4, memory=64, env=prodos=RHEL7 - Host D:
cpu=4, memory=64, env=prodos=RHCOS(Red Hat CoreOS)
If you resize the default worker pool to request 3 more worker nodes, only Host C can be automatically assigned, but not Host A or Host B.
- Host A meets the central processing unit (CPU) and
env=prodlabel requests, but can only be assigned inus-east-1b. Because thedefaultworker pool is only inus-east-1a, Host A is not assigned. - Host B meets the CPU and zone requests. However, the host does not have the
env=prodlabel, and so is not assigned. - Host C is automatically assigned because it matches the
cpu=4andenv=prodhost labels, and does not have any zone restrictions. Thememory=64host label is not considered, because the worker pool does not request amemorylabel. - Host D meets the CPU, zone, and
env=prodlabel requests, but does not meet theosrequest ofRHEL7, and so is not assigned.
Hosts must be assigned as worker nodes in each zone of the default worker pool in your cluster. If your default worker pool spans multiple zones, ensure that you have hosts with matching labels that can be assigned in each zone.
Automatically assigning hosts
IBM Cloud Satellite automatically assigns hosts to worker pools in clusters that request compute capacity using host labels such as cpu.
Before you begin, make sure that you create a Satellite cluster. If you create a cluster in the CLI, you must specify the --workers option with the number of hosts you want to automatically assign. Then, make sure that you attach hosts to your Satellite location, but do not assign the hosts to any resources.
-
Review the host labels that the worker pools use to request compute capacity. You have several options.
- Create a worker pool in a Satellite cluster with the host labels that you want to use for auto assignment.
- Review existing worker pools for their host labels. Note that you cannot update the host labels that a worker pool has. You can review the Host labels by running the
ibmcloud oc worker-pool get -c <cluster> --worker-pool <worker_pool>command. - Review the host labels that a Satellite-enabled IBM Cloud service cluster uses to request resources from the Satellite-enabled IBM Cloud service instance console.
-
Review the host labels that your available hosts have. Remember that hosts automatically get
cpuandmemorylabels when you attach the host to your Satellite location.- Get the Satellite location name.
ibmcloud sat location ls - List the available (unassigned) hosts in your location, and note the IDs of the hosts that you want to check the labels for.
ibmcloud sat host ls --location LOCATION_NAME_OR_ID | grep unassigned - For each host that you want to check, get the host details and note the Labels in the output.
Example outputibmcloud sat host get --location LOCATION_NAME_OR_ID --host HOST_NAME_OR_ID... Labels app webserver cpu 4 memory 3874564 os RHCOS ...
- Get the Satellite location name.
-
Update the labels of your available host to match all the labels of the worker pool that you want the host to be available for automatic assignment. You can optionally specify a zone to make sure that the host only gets automatically assigned to that zone.
The
cpu,os, andmemorylabels on the host are applied automatically and cannot be edited.ibmcloud sat host update --location <location_name_or_ID> --host <host_name_or_ID> -hl <key=value> [-hl <key=value>] [--zone <zone1>]
Disabling host auto assignment
The following actions disable host auto assignment for a worker pool. Later, you can reenable host auto assignment.
Re-enabling host auto assignment
If you disabled host auto assignment, you can re-enable auto assignment.
- Make sure that you have available hosts with labels that match the host labels of the worker pool.
- Resize the worker pool to set the requested size per zone, rebalance the worker pool, and enable auto assignment again.
For Satellite clusters, do not use the ibmcloud oc worker-pool rebalance command if you have manually assigned worker nodes to your worker pool. Rebalancing a pool with manually assigned worker nodes removes more than the expected
number of worker nodes.