Chapter 9. Assigning roles to hosts
You can assign roles to your discovered hosts. These roles define the function of the host within the cluster. The roles can be one of the standard Kubernetes types: control plane (master) or worker.
The host must meet the minimum requirements for the role you selected. You can find the hardware requirements by referring to the Prerequisites section of this document or using the preflight requirement API.
If you do not select a role, the system selects one for you. You can change the role at any time before installation starts.
9.1. Selecting a role by using the web console
You can select a role after the host finishes its discovery.
Procedure
- Go to the Host Discovery tab and scroll down to the Host Inventory table.
- Select the Auto-assign drop-down for the required host.
- Select Control plane node to assign this host a control plane role.
- Select Worker to assign this host a worker role.
- Check the validation status.
9.2. Selecting a role by using the API
You can select a role for the host by using the /v2/infra-envs/{infra_env_id}/hosts/{host_id} endpoint. A host can have one of the following roles:
-
master
: A host with themaster
role operates as a control plane node. -
worker
: A host with theworker
role operates as a worker node.
By default, the Assisted Installer sets a host to auto-assign
, which means the Assisted Installer will determine whether the host is a master
or worker
role automatically. Use this procedure to set the host’s role.
Prerequisites
- You have added hosts to the cluster.
Procedure
Refresh the API token:
$ source refresh-token
Get the host IDs:
$ curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID" \ --header "Content-Type: application/json" \ -H "Authorization: Bearer $API_TOKEN" \ | jq '.host_networks[].host_ids'
Example output
[ "1062663e-7989-8b2d-7fbb-e6f4d5bb28e5" ]
Modify the
host_role
setting:$ curl https://api.openshift.com/api/assisted-install/v2/infra-envs/${INFRA_ENV_ID}/hosts/<host_id> \ -X PATCH \ -H "Authorization: Bearer ${API_TOKEN}" \ -H "Content-Type: application/json" \ -d ' { "host_role":"worker" } ' | jq
Replace
<host_id>
with the ID of the host.
9.3. Auto-assigning roles
Assisted Installer selects a role automatically for hosts if you do not assign a role yourself. The role selection mechanism factors the host’s memory, CPU, and disk space. It aims to assign a control plane role to the 3 weakest hosts that meet the minimum requirements for control plane nodes. All other hosts default to worker nodes. The goal is to provide enough resources to run the control plane and reserve the more capacity-intensive hosts for running the actual workloads.
You can override the auto-assign decision at any time before installation.
The validations make sure that the auto selection is a valid one.