6.4. Adding worker nodes to an on-premise cluster
You can add worker nodes to on-premise clusters by using the OpenShift CLI (oc) to generate an ISO image, which can then be used to boot one or more nodes in your target cluster. This process can be used regardless of how you installed your cluster.
You can add one or more nodes at a time while customizing each node with more complex configurations, such as static network configuration, or you can specify only the MAC address of each node. Any required configurations that are not specified during ISO generation are retrieved from the target cluster and applied to the new nodes.
Machine or BareMetalHost resources are not automatically created after a node has been successfully added to the cluster.
Preflight validation checks are also performed when booting the ISO image to inform you of failure-causing issues before you attempt to boot each node.
- Supported platforms
The following platforms are supported for this method of adding nodes:
-
baremetal -
vsphere -
nutanix -
none
-
- Supported architectures
The following architecture combinations have been validated to work when adding worker nodes using this process:
-
amd64worker nodes onamd64orarm64clusters -
arm64worker nodes onamd64orarm64clusters -
s390xworker nodes ons390xclusters -
ppc64leworker nodes onppc64leclusters
-
- Adding nodes to your cluster
You can add nodes with this method in the following two ways:
Adding one or more nodes using a configuration file.
You can specify configurations for one or more nodes in the
nodes-config.yamlfile before running theoc adm node-image createcommand. This is useful if you want to add more than one node at a time, or if you are specifying complex configurations.Adding a single node using only command flags.
You can add a node by running the
oc adm node-image createcommand with flags to specify your configurations. This is useful if you want to add only a single node at a time, and have only simple configurations to specify for that node.
6.4.1. Adding one or more nodes using a configuration file 링크 복사링크가 클립보드에 복사되었습니다!
You can add one or more nodes to your cluster by using the nodes-config.yaml file to specify configurations for the new nodes.
Prerequisites
-
You have installed the OpenShift CLI (
oc) - You have installed the Rsync utility
- You have an active connection to your target cluster
- You have a kubeconfig file available
Procedure
Create a new YAML file that contains configurations for the nodes you are adding and is named
nodes-config.yaml. You must provide a MAC address for each new node.In the following example file, two new workers are described with an initial static network configuration:
Example
nodes-config.yamlfilehosts: - hostname: extra-worker-1 rootDeviceHints: deviceName: /dev/sda interfaces: - macAddress: 00:00:00:00:00:00 name: eth0 networkConfig: interfaces: - name: eth0 type: ethernet state: up mac-address: 00:00:00:00:00:00 ipv4: enabled: true address: - ip: 192.168.122.2 prefix-length: 23 dhcp: false - hostname: extra-worker-2 rootDeviceHints: deviceName: /dev/sda interfaces: - macAddress: 00:00:00:00:00:02 name: eth0 networkConfig: interfaces: - name: eth0 type: ethernet state: up mac-address: 00:00:00:00:00:02 ipv4: enabled: true address: - ip: 192.168.122.3 prefix-length: 23 dhcp: falseGenerate the ISO image by running the following command:
$ oc adm node-image create중요In order for the
createcommand to fetch a release image that matches the target cluster version, you must specify a valid pull secret. You can specify the pull secret either by using the--registry-configflag or by setting theREGISTRY_AUTH_FILEenvironment variable beforehand.참고If the directory of the
nodes-config.yamlfile is not specified by using the--dirflag, the tool looks for the file in the current directory.-
Verify that a new
node.<arch>.isofile is present in the asset directory. The asset directory is your current directory, unless you specified a different one when creating the ISO image. - Boot the selected node with the generated ISO image.
Track progress of the node creation by running the following command:
$ oc adm node-image monitor --ip-addresses <ip_addresses>where:
<ip_addresses>Specifies a list of the IP addresses of the nodes that are being added.
참고If reverse DNS entries are not available for your node, the
oc adm node-image monitorcommand skips checks for pending certificate signing requests (CSRs). If these checks are skipped, you must manually check for CSRs by running theoc get csrcommand.
Approve the CSRs by running the following command for each CSR:
$ oc adm certificate approve <csr_name>