|
| 1 | +# Adding a node via the node-joiner tool |
| 2 | + |
| 3 | +## Pre-requisites |
| 4 | +1. The `oc` tool must be available in the execution environment (the "user host"). |
| 5 | +2. The user host has a valid network connection to the target OpenShift cluster to be expanded. |
| 6 | +3. The user host has a valid pull-secret. |
| 7 | + |
| 8 | +## Setup |
| 9 | +1. Download the [node-joiner.sh](./node-joiner.sh) script in a working directory in |
| 10 | + the user host (the "assets folder"). |
| 11 | +2. Create a `nodes-config.yaml` in the assets folder. This configuration file must contain the |
| 12 | + list of all the nodes that the user wants to add to the target cluster. For each node it must be |
| 13 | + specified at least the name and the primary interface mac address, for example: |
| 14 | +``` |
| 15 | +hosts: |
| 16 | + - hostname: extra-worker-0 |
| 17 | + interfaces: |
| 18 | + - name: eth0 |
| 19 | + macAddress: 00:02:46:e3:9e:7c |
| 20 | + - hostname: extra-worker-1 |
| 21 | + interfaces: |
| 22 | + - name: eth0 |
| 23 | + macAddress: 00:02:46:e3:9e:8c |
| 24 | + - hostname: extra-worker-2 |
| 25 | + interfaces: |
| 26 | + - name: eth0 |
| 27 | + macAddress: 00:02:46:e3:9e:9c |
| 28 | +``` |
| 29 | +3. Optionally, it's possible to specify - for each node - an `NMState` configuration block |
| 30 | + (it will be applied during the first boot), for example: |
| 31 | +``` |
| 32 | +hosts: |
| 33 | + - hostname: extra-worker-0 |
| 34 | + interfaces: |
| 35 | + - name: eth0 |
| 36 | + macAddress: 00:02:46:e3:9e:7c |
| 37 | + networkConfig: |
| 38 | + interfaces: |
| 39 | + - name: eth0 |
| 40 | + type: ethernet |
| 41 | + state: up |
| 42 | + mac-address: 00:02:46:e3:9e:7c |
| 43 | + ipv4: |
| 44 | + enabled: true |
| 45 | + address: |
| 46 | + - ip: 192.168.111.90 |
| 47 | + prefix-length: 24 |
| 48 | + dhcp: false |
| 49 | + dns-resolver: |
| 50 | + config: |
| 51 | + server: |
| 52 | + - 192.168.111.1 |
| 53 | + routes: |
| 54 | + config: |
| 55 | + - destination: 0.0.0.0/0 |
| 56 | + next-hop-address: 192.168.111.1 |
| 57 | + next-hop-interface: eth0 |
| 58 | + table-id: 254 |
| 59 | + - hostname: extra-worker-1 |
| 60 | + interfaces: |
| 61 | + - name: eth0 |
| 62 | + macAddress: 00:02:46:e3:9e:8c |
| 63 | + - hostname: extra-worker-2 |
| 64 | + interfaces: |
| 65 | + - name: eth0 |
| 66 | + macAddress: 00:02:46:e3:9e:9c |
| 67 | +
|
| 68 | +## ISO generation |
| 69 | +Run the [node-joiner.sh](./node-joiner.sh) by specifying the location of the current pull secret: |
| 70 | +```bash |
| 71 | +$ ./node-joiner.sh ~/config/pull-secret |
| 72 | +``` |
| 73 | +The script will generate a temporary namespace `openshift-node-joiner` in the target cluster, |
| 74 | +where a pod will be launched to execute the effective node-joiner workload. |
| 75 | +In case of success, the `agent-addnodes.x86_64.iso` ISO image will be downloaded in the assets folder. |
| 76 | + |
| 77 | +## Nodes joining |
| 78 | +Use the iso image to boot all the nodes listed in the `nodes-config.yaml` file, and wait for the related |
| 79 | +certificate signing requests (CSRs) to appear. When adding a new node to the cluster, two pending CSRs will |
| 80 | +be generated, and they must be manually approved by the user. |
| 81 | +Use the following command to monitor the pending certificates: |
| 82 | +``` |
| 83 | +$ oc get csr |
| 84 | +``` |
| 85 | +User the `oc` `approve` command to approve them: |
| 86 | +``` |
| 87 | +$ oc adm certificate approve <csr_name> |
| 88 | +``` |
| 89 | +Once all the pendings certificates will be approved, then the new node will become available: |
| 90 | +``` |
| 91 | +$ oc get nodes |
| 92 | +NAME STATUS ROLES AGE VERSION |
| 93 | +extra-worker-0 Ready worker 1h v1.29.3+8628c3c |
| 94 | +master-0 Ready control-plane,master 31h v1.29.3+8628c3c |
| 95 | +master-1 Ready control-plane,master 32h v1.29.3+8628c3c |
| 96 | +master-2 Ready control-plane,master 32h v1.29.3+8628c3c |
| 97 | +``` |
0 commit comments