You can maintain the details of the bare metal hosts in your cluster from the OKD web console. Navigate to Compute → Bare 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:
-
Annotates the bare metal host CR with cluster.k8s.io/delete-machine: true
-
Scales down the related machine set
|
Powering off the host without first moving the daemon set and unmanaged static pods to another node can cause service disruption and loss of data.
|
You can add bare metal hosts to the cluster in the web console.
Procedure
-
In the web console, navigate to Compute → Bare Metal Hosts.
-
Select Add Host → New with Dialog.
-
Specify a unique name for the new bare metal host.
-
Set the Boot MAC address.
-
Set the Baseboard Management Console (BMC) Address.
-
Optionally, enable power management for the host. This allows OKD to control the power state of the host.
-
Enter the user credentials for the host’s baseboard management controller (BMC).
-
Select to power on the host after creation, and select Create.
-
Scale up the number of replicas to match the number of available bare metal hosts. Navigate to Compute → MachineSets, and increase the number of machine replicas in the cluster by selecting Edit Machine count from the Actions drop-down menu.
|
You can also manage the number of bare metal nodes using the oc scale command and the appropriate bare metal machine set.
|
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 cluster-admin
privileges.
-
Create a secret
CR for the bare metal host.
Procedure
-
In the web console, navigate to Compute → Bare Metal Hosts.
-
Select Add Host → New from YAML.
-
Copy and paste the below YAML, modifying the relevant fields with the details of your host:
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
name: <bare_metal_host_name>
spec:
online: true
bmc:
address: <bmc_address>
credentialsName: <secret_credentials_name> (1)
disableCertificateVerification: True
bootMACAddress: <host_boot_mac_address>
hardwareProfile: unknown
1 |
credentialsName must reference a valid secret CR. The baremetal-operator cannot manage the bare metal host without a valid secret referenced in the credentialsName . For more information about secrets and how to create them, see Understanding secrets. |
-
Select Create to save the YAML and create the new bare metal host.
-
Scale up the number of replicas to match the number of available bare metal hosts. Navigate to Compute → MachineSets, and increase the number of machines in the cluster by selecting Edit Machine count from the Actions drop-down menu.
|
You can also manage the number of bare metal nodes using the oc scale command and the appropriate bare metal machine set.
|
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 MachineSet
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
-
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.
$ oc annotate machineset <machineset> -n openshift-machine-api 'metal3.io/autoscale-to-hosts=<any_value>'
Wait for the new scaled machines to start.
|
When you use a BareMetalHost object to create a machine in the cluster and labels or selectors are subsequently changed on the BareMetalHost , the BareMetalHost object continues be counted against the MachineSet that the Machine object was created from.
|