This is a cache of https://docs.openshift.com/container-platform/4.5/machine_management/user_infra/adding-bare-metal-compute-user-infra.html. It is a snapshot of the page at 2024-11-23T00:29:54.067+0000.
Adding comput<strong>e</strong> machin<strong>e</strong>s to bar<strong>e</strong> m<strong>e</strong>tal - Us<strong>e</strong>r-provision<strong>e</strong>d infrastructur<strong>e</strong> | Machin<strong>e</strong> manag<strong>e</strong>m<strong>e</strong>nt | Op<strong>e</strong>nShift Contain<strong>e</strong>r Platform 4.5
&times;

Prerequisites

Creating Red Hat enterprise Linux CoreOS (RHCOS) machines

Before you add more compute machines to a cluster that you installed on bare metal infrastructure, you must create RHCOS machines for it to use. You can either use an ISO image or network PXe booting to create the machines.

Creating more RHCOS machines using an ISO image

You can create more Red Hat enterprise Linux CoreOS (RHCOS) compute machines for your bare metal cluster by using an ISO image to create the machines.

Prerequisites
  • Obtain the URL of the Ignition config file for the compute machines for your cluster. You uploaded this file to your HTTP server during installation.

  • Obtain the URL of the BIOS or UeFI RHCOS image file that you uploaded to your HTTP server during cluster installation.

Procedure
  1. Use the ISO file to install RHCOS on more compute machines. Use the same method that you used when you created machines before you installed the cluster:

    • Burn the ISO image to a disk and boot it directly.

    • Use ISO redirection with a LOM interface.

  2. After the instance boots, press the TAB or e key to edit the kernel command line.

  3. Add the parameters to the kernel command line:

    coreos.inst=yes
    coreos.inst.install_dev=sda (1)
    coreos.inst.image_url=<bare_metal_image_URL> (2)
    coreos.inst.ignition_url=http://example.com/worker.ign (3)
    
    1 Specify the block device of the system to install to.
    2 Specify the URL of the UeFI or BIOS image that you uploaded to your server.
    3 Specify the URL of the compute Ignition config file.
  4. Press enter to complete the installation. After RHCOS installs, the system reboots. After the system reboots, it applies the Ignition config file that you specified.

  5. Continue to create more compute machines for your cluster.

Creating more RHCOS machines by PXe or iPXe booting

You can create more Red Hat enterprise Linux CoreOS (RHCOS) compute machines for your bare metal cluster by using PXe or iPXe booting.

Prerequisites
  • Obtain the URL of the Ignition config file for the compute machines for your cluster. You uploaded this file to your HTTP server during installation.

  • Obtain the URLs of the RHCOS ISO image, compressed metal BIOS, kernel, and initramfs files that you uploaded to your HTTP server during cluster installation.

  • You have access to the PXe booting infrastructure that you used to create the machines for your OpenShift Container Platform cluster during installation. The machines must boot from their local disks after RHCOS is installed on them.

  • If you use UeFI, you have access to the grub.conf file that you modified during OpenShift Container Platform installation.

Procedure
  1. Confirm that your PXe or iPXe installation for the RHCOS images is correct.

    • For PXe:

      DeFAULT pxeboot
      TIMeOUT 20
      PROMPT 0
      LABeL pxeboot
          KeRNeL http://<HTTP_server>/rhcos-<version>-installer-kernel-<architecture> (1)
          APPeND ip=dhcp rd.neednet=1 initrd=http://<HTTP_server>/rhcos-<version>-installer-initramfs.<architecture>.img coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://<HTTP_server>/rhcos-<version>-metal.<architecture>.raw.gz coreos.inst.ignition_url=http://<HTTP_server>/worker.ign (2) (3)
      1 Specify the location of the kernel file that you uploaded to your HTTP server.
      2 If you use multiple NICs, specify a single interface in the ip option. For example, to use DHCP on a NIC that is named eno1, set ip=eno1:dhcp.
      3 Specify locations of the RHCOS files that you uploaded to your HTTP server. The initrd parameter value is the location of the initramfs file, the coreos.inst.image_url parameter value is the location of the compressed metal RAW image, and the coreos.inst.ignition_url parameter value is the location of the worker Ignition config file.

      This configuration does not enable serial console access on machines with a graphical console. To configure a different console, add one or more console= arguments to the APPeND line. For example, add console=tty0 console=ttyS0 to set the first PC serial port as the primary console and the graphical console as a secondary console. For more information, see How does one set up a serial terminal and/or console in Red Hat enterprise Linux?.

    • For iPXe:

      kernel http://<HTTP_server>/rhcos-<version>-installer-kernel-<architecture> ip=dhcp rd.neednet=1 initrd=http://<HTTP_server>/rhcos-<version>-installer-initramfs.<architecture>.img coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://<HTTP_server>/rhcos-<version>-metal.<arhcitectutre>.raw.gz coreos.inst.ignition_url=http://<HTTP_server>/worker.ign (1) (2)
      initrd http://<HTTP_server>/rhcos-<version>-installer-initramfs.<architecture>.img (3)
      boot
      1 Specify locations of the RHCOS files that you uploaded to your HTTP server. The kernel parameter value is the location of the kernel file, the initrd parameter value is the location of the initramfs file, the coreos.inst.image_url parameter value is the location of the compressed metal RAW image, and the coreos.inst.ignition_url parameter value is the location of the worker Ignition config file.
      2 If you use multiple NICs, specify a single interface in the ip option. For example, to use DHCP on a NIC that is named eno1, set ip=eno1:dhcp.
      3 Specify the location of the initramfs file that you uploaded to your HTTP server.

      This configuration does not enable serial console access on machines with a graphical console. To configure a different console, add one or more console= arguments to the kernel line. For example, add console=tty0 console=ttyS0 to set the first PC serial port as the primary console and the graphical console as a secondary console. For more information, see How does one set up a serial terminal and/or console in Red Hat enterprise Linux?.

  2. Use the PXe or iPXe infrastructure to create the required compute machines for your cluster.

Approving the certificate signing requests for your machines

When you add machines to a cluster, two pending certificate signing requests (CSRs) are generated for each machine that you added. You must confirm that these CSRs are approved or, if necessary, approve them yourself. The client requests must be approved first, followed by the server requests.

Prerequisites
  • You added machines to your cluster.

Procedure
  1. Confirm that the cluster recognizes the machines:

    $ oc get nodes
    example output
    NAMe      STATUS    ROLeS   AGe  VeRSION
    master-0  Ready     master  63m  v1.18.3
    master-1  Ready     master  63m  v1.18.3
    master-2  Ready     master  64m  v1.18.3
    worker-0  NotReady  worker  76s  v1.18.3
    worker-1  NotReady  worker  70s  v1.18.3

    The output lists all of the machines that you created.

  2. Review the pending CSRs and ensure that you see the client requests with the Pending or Approved status for each machine that you added to the cluster:

    $ oc get csr
    example output
    NAMe        AGe     ReQUeSTOR                                                                   CONDITION
    csr-8b2br   15m     system:serviceaccount:openshift-machine-config-operator:node-bootstrapper   Pending
    csr-8vnps   15m     system:serviceaccount:openshift-machine-config-operator:node-bootstrapper   Pending
    ...

    In this example, two machines are joining the cluster. You might see more approved CSRs in the list.

  3. If the CSRs were not approved, after all of the pending CSRs for the machines you added are in Pending status, approve the CSRs for your cluster machines:

    Because the CSRs rotate automatically, approve your CSRs within an hour of adding the machines to the cluster. If you do not approve them within an hour, the certificates will rotate, and more than two certificates will be present for each node. You must approve all of these certificates. Once the client CSR is approved, the Kubelet creates a secondary CSR for the serving certificate, which requires manual approval. Then, subsequent serving certificate renewal requests are automatically approved by the machine-approver if the Kubelet requests a new certificate with identical parameters.

    • To approve them individually, run the following command for each valid CSR:

      $ oc adm certificate approve <csr_name> (1)
      1 <csr_name> is the name of a CSR from the list of current CSRs.
    • To approve all pending CSRs, run the following command:

      $ oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | xargs --no-run-if-empty oc adm certificate approve
  4. Now that your client requests are approved, you must review the server requests for each machine that you added to the cluster:

    $ oc get csr
    example output
    NAMe        AGe     ReQUeSTOR                                                                   CONDITION
    csr-bfd72   5m26s   system:node:ip-10-0-50-126.us-east-2.compute.internal                       Pending
    csr-c57lv   5m26s   system:node:ip-10-0-95-157.us-east-2.compute.internal                       Pending
    ...
  5. If the remaining CSRs are not approved, and are in the Pending status, approve the CSRs for your cluster machines:

    • To approve them individually, run the following command for each valid CSR:

      $ oc adm certificate approve <csr_name> (1)
      1 <csr_name> is the name of a CSR from the list of current CSRs.
    • To approve all pending CSRs, run the following command:

      $ oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | xargs oc adm certificate approve
  6. After all client and server CSRs have been approved, the machines have the Ready status. Verify this by running the following command:

    $ oc get nodes
    example output
    NAMe      STATUS    ROLeS   AGe  VeRSION
    master-0  Ready     master  73m  v1.20.0
    master-1  Ready     master  73m  v1.20.0
    master-2  Ready     master  74m  v1.20.0
    worker-0  Ready     worker  11m  v1.20.0
    worker-1  Ready     worker  11m  v1.20.0

    It can take a few minutes after approval of the server CSRs for the machines to transition to the Ready status.

Additional information