Managing bare metal hosts

    To provision a Fedora CoreOS (FCOS) bare metal host as a node in your cluster, first create a MachineSet custom resource (CR) object that corresponds to the bare metal host hardware. Bare metal host machine sets describe infrastructure components specific to your configuration. You apply specific Kubernetes labels to these machine sets and then update the infrastructure components to run on only those machines.

    Machine CR’s are created automatically when you scale up the relevant MachineSet containing a metal3.io/autoscale-to-hosts annotation. OKD uses Machine CR’s to provision the bare metal node that corresponds to the host as specified in the MachineSet CR.

    Maintaining bare metal hosts

    You can maintain the details of the bare metal hosts in your cluster from the OKD web console. Navigate to ComputeBare Metal Hosts, and select a task from the Actions drop down menu. Here you can manage items such as BMC details, boot MAC address for the host, enable power management, and so on. You can also review the details of the network interfaces and drives for the host.

    You can move a bare metal host into maintenance mode. When you move a host into maintenance mode, the scheduler moves all managed workloads off the corresponding bare metal node. No new workloads are scheduled while in maintenance mode.

    You can deprovision a bare metal host in the web console. Deprovisioning a host does the following actions:

    1. Annotates the bare metal host CR with cluster.k8s.io/delete-machine: true

    2. Scales down the related machine set

    Additional Resources

    You can add bare metal hosts to the cluster in the web console.

    Prerequisites

    • Install an FCOS cluster on bare metal.

    • Log in as a user with cluster-admin privileges.

    Procedure

    1. Specify a unique name for the new bare metal host.

    2. Set the Boot MAC address.

    3. Set the Baseboard Management Console (BMC) Address.

    4. Optional: Enable power management for the host. This allows OKD to control the power state of the host.

    5. Enter the user credentials for the host’s baseboard management controller (BMC).

    6. Select to power on the host after creation, and select Create.

    7. Scale up the number of replicas to match the number of available bare metal hosts. Navigate to ComputeMachineSets, and increase the number of machine replicas in the cluster by selecting Edit Machine count from the Actions drop-down menu.

    You can add bare metal hosts to the cluster in the web console using a YAML file that describes the bare metal host.

    Prerequisites

    • Install a FCOS compute machine on bare metal infrastructure for use in the cluster.

    • Log in as a user with privileges.

    Procedure

    1. In the web console, navigate to ComputeBare Metal Hosts.

    2. Copy and paste the below YAML, modifying the relevant fields with the details of your host:

    3. Select Create to save the YAML and create the new bare metal host.

    4. Scale up the number of replicas to match the number of available bare metal hosts. Navigate to ComputeMachineSets, and increase the number of machines in the cluster by selecting Edit Machine count from the Actions drop-down menu.

    To automatically create the number of Machine objects that matches the number of available BareMetalHost objects, add a metal3.io/autoscale-to-hosts annotation to the object.

    Prerequisites

    • Install FCOS bare metal compute machines for use in the cluster, and create corresponding BareMetalHost objects.

    • Install the OKD CLI (oc).

    • Log in as a user with cluster-admin privileges.

    Procedure

    1. Annotate the machine set that you want to configure for automatic scaling by adding the metal3.io/autoscale-to-hosts annotation. Replace <machineset> with the name of the machine set.

      1. $ oc annotate machineset <machineset> -n openshift-machine-api 'metal3.io/autoscale-to-hosts=<any_value>'

      Wait for the new scaled machines to start.

    Additional resources