Deploying Metal³ Hosts

Create/Add bare metal hosts in bulk

If there are multiple bare metal hosts which have common BMC credentials, you do not need to create bare metal hosts individually. You can create a cronjob using the below yaml file.

This cronjob will create bare metal hosts for each IPMI address in the specified IPMI address range (using IPMI_RANGE_START and IPMI_RANGE_END variables) if IPMI responds on that address and another bare metal host has not already taken this IPMI address. In addition, BMC secrets are created for each bare metal host using the username and password provided in the yaml file.

Note: The cronjob would run periodically and will continue to create bare metal hosts in the event a bare metal host gets deleted.

Environment variables to be customized:

PREFIX: The prefix is used to form a bare metal host object name. Bare metal hosts will be named as (<prefix>_<ipmi-address>).

IPMI_RANGE_START: starting address in the IPMI address range

IPMI_RANGE_END: end address in the IPMI address range

BMC_PORT: common BMC port used for nodes

USERNAME: common username used by bare metal hosts for BMC

PASSWORD: common password used by bare metal hosts for BMC

YAML
Copy

Adding individual bare metal hosts

If adding a single bare metal host, you can deploy using the the following steps to create bare metal hosts via Kubernetes CLI.

Step1:

SSH to your cluster node.

Step 2:

Apply the following YAML file by modifying the details as per your bare metal host to create a bare metal host object.

YAML
Copy

Step 3:

After applying the above YAML run the following command to track the bare metal hosts states. It will take some time to inspect the node.

Command: kubectl get baremetalhost -n baremetal-operator-system -w

You can also look at the details of a host, including the hardware information gathered by doing pre-deployment introspection

using the following command:

Bash
Copy

Example put from the command above:

Step 4:

In order to provision a bare metal host the must be in the ready state, meaning it’s available for provisioning. To provision, the host add image details to be deployed on the host in the YAML above (step #2) as shown below and apply the file. This example also contains an example on how to create a K8 secret. Note: A status of provisioned indicates that an OS has already been deployed on that bare metal host.

YAML
Copy

Step 5:

Now your node is provisioned and booting with the OS image chosen. Note that STATE of the host has changed to provisioned.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard