The module lifecycle stage: Experimental

The module has requirements for installation

Before enabling the module, you need to allow the use of experimental modules in the deckhouse ModuleConfig. To do this, set the allowExperimentalModules parameter to true.

Choosing the Ironic mode

Ironic manages server power through their baseboard management controllers (BMCs) and installs an operating system on servers. The module can deploy Ironic in the cluster by itself or connect to Ironic deployed outside the cluster. The Ironic mode is set in the nodes.parameters.ironic parameter.

To deploy Ironic in the cluster, set the provisioningNetwork and dhcp parameters. To connect to an external Ironic, set the externalInstance parameter. Parameters of different modes cannot be set at the same time.

Ironic in the cluster

Ironic uses the network interfaces of the node it runs on. The module does not pin Ironic to a specific node, so every node where Ironic can start must be connected to the provisioning network where servers boot over PXE. Specify the name of the network interface connected to this network in the provisioningNetwork.interface parameter.

In the provisioningNetwork.ipAddress parameter, specify a free IPv4 address in the provisioning network. Ironic assigns this address to the interface by itself and accepts connections on it on the following TCP ports:

Port Purpose
6180 HTTP server with images for server boot
6385 Ironic API
6183 Virtual media HTTPS server if TLS is enabled
8084 HTTPS server for iPXE if TLS is enabled

For PXE boot, servers get network settings from a DHCP server. To have Ironic assign addresses to servers by itself, set the dhcp.internal parameter with the subnet and the address range. If a DHCP server already runs in the provisioning network, set the dhcp.external parameter and configure PXE boot on that DHCP server yourself.

During preparation, servers boot from the Ironic Python Agent (IPA) service image. By default, the built-in IPA image is used, referenced by the baremetal-default-ramdisk BareMetalRamdiskImage resource. The module creates this resource by itself. To use a different image, create your own BareMetalRamdiskImage resource and set its name in the ramdiskImageRef parameter.

External Ironic

In this mode, the module does not deploy Ironic or a DHCP server in the cluster, and network boot of servers is provided by the external Ironic. Set its API address in the externalInstance.endpoint parameter. The address must end with /v1 or /v1/.

If the API requires authentication, create a Secret with credentials in the d8-infra-provider-baremetal namespace and specify it in the externalInstance.credentialsRef parameter.

To have the Ironic API certificate verified on connection, specify the CA certificate in the externalInstance.tls.caCertRef parameter. If Ironic requires a client certificate, specify it in the externalInstance.tls.clientCertRef parameter.

The module does not pass BMC CA certificates to the external Ironic, and for BareMetalInstance resources with the spec.bmc.tls.caCertRef parameter it reports an error and does not create a BareMetalHost. Configure trust for BMC certificates in the external Ironic itself.

Initializing Kubernetes nodes

The module deploys its Cloud Controller Manager for both managed and external Ironic. It matches each Node to its CAPI Machine, Metal3Machine, and BareMetalHost, sets the Metal3 providerID, and removes node.cloudprovider.kubernetes.io/uninitialized after initialization. It does not remove the bashible initialization taint.

A module bashible step publishes the installed operating system’s internal IP address for CCM. On first boot, it uses the source address of the route to the control plane. Addresses collected by IPA during inspection are not used as node addresses, since the provisioning network can differ from the node network. OS images must support cloud-init and apply the hostname supplied by Metal3DataTemplate.

Registering physical servers

To make a server available for nodes, describe it in a BareMetalInstance resource. BareMetalInstance is cluster-scoped: omit metadata.namespace from its manifest. Specify the namespace of the BMC credentials Secret in spec.bmc.credentialsRef.namespace. If omitted, d8-infra-provider-baremetal is used.

The requirements for the credentials Secret are listed in the description of the spec.bmc.credentialsRef parameter.

Connecting to the BMC

The BMC address is set in the spec.bmc.ipAddress parameter. The module connects to the BMC over the Redfish or IPMI protocol. It checks the protocols in the following order and uses the first one through which the server is found:

  1. Redfish over HTTPS
  2. Redfish over HTTP if the spec.bmc.allowHTTP parameter is set to true
  3. IPMI

By default, the module uses port 443 for Redfish over HTTPS, port 80 for Redfish over HTTP, and port 623 for IPMI. If the BMC accepts connections on a different port, specify it in the spec.bmc.port parameter. In this case, the module uses the specified port for all protocols. The timeout of each check is set by the bmcProbeTimeoutSeconds parameter in the module settings.

In the spec.bmc.systemUUID parameter, specify the server UUID reported by its BMC. The module uses this UUID to select the server among all servers managed by the BMC. If there is no server with this UUID, the module reports an error and does not register the server.

The module verifies the BMC certificate against the system root certificates. If the BMC certificate is issued by a private CA, create a Secret with the PEM-encoded CA certificate in the d8-infra-provider-baremetal namespace and specify it in the spec.bmc.tls.caCertRef parameter. Ironic in the cluster uses a common set of CA certificates from all BareMetalInstance resources, so a CA certificate specified for one server is trusted when connecting to the BMC of any server.

Server parameters

In the spec.bootMACAddress parameter, specify the MAC address of the network interface the server boots from over PXE. If the server has several disks, specify the root disk hints in the spec.rootDeviceHints parameter.

Add labels to the BareMetalInstance resource so that an instance class can select the server for nodes. The selection rules are set in the hostSelector parameter of the instance class.

Checking server state

To check the server state, run the following command:

d8 k get baremetalinstances

Example output:

NAME        BMC              BOOT MAC            STATE       DESIRED ONLINE   POWERED ON   ERROR   AGE
worker-01   192.168.201.32   f0:3f:03:01:1d:22   available   false            false                15m

The server is ready for a node when the STATE column shows available. If the module fails to connect to the BMC or to prepare resources for the server, the ERROR column shows an error message. The main error messages:

Message Description
BMC credentials are invalid or unavailable. The credentials Secret is not found, has a different type, or lacks the required keys
Unable to resolve the BMC endpoint. The BMC is unreachable over all protocols, rejects the credentials, or does not report a server with the specified systemUUID
Unable to synchronize the BMC CA certificate. The CA certificate Secret is not found or does not contain a PEM-encoded CA certificate, or Ironic in the cluster has not been created yet
BMC CA certificates are not supported with an external Ironic instance. The spec.bmc.tls.caCertRef parameter is set while connected to an external Ironic
Unable to synchronize the BMC credentials Secret. Failed to create or update the service Secret with BMC credentials
Unable to synchronize the physical host. Failed to create or update the BareMetalHost resource for the server
A generated resource with the required name is owned by another object. The BareMetalHost resource or the service Secret for this server already exists and belongs to another BareMetalInstance resource or was created manually

Creating nodes

The node-manager module creates nodes on physical servers in node groups with the CloudEphemeral type. Such groups need a BareMetalImage resource with the operating system image and a BareMetalInstanceClass resource with node parameters.

Ironic installs the image from the BareMetalImage resource on the server, so the image must meet the module requirements. The instance class refers to the image and selects servers by the labels of BareMetalInstance resources.

The spec.direct parameters of BareMetalImage are immutable. To update the operating system image, create a BareMetalImage with a new name and change imageRef in the instance class. This change starts a rollout for groups using that instance class.

If the node group can scale from zero (the minPerZone parameter is 0), specify the server CPU and memory in the capacity parameter of the instance class. Cluster autoscaler uses these values while the group has no nodes. Without them, the Capacity calculation failed error appears in the node group status.

To create nodes, create a node group (NodeGroup) with the CloudEphemeral type and specify the instance class in the cloudInstances.classReference parameter. Physical servers use a single default zone, so you can omit the cloudInstances.zones parameter.

Nodes of the group are recreated if you change one of the following parameters:

Enabling TLS for server boot

By default, servers download images and access Ironic over HTTP. You can protect this traffic with TLS only in the Ironic in the cluster mode with the built-in DHCP server (the dhcp.internal parameter). If you set the TLS parameters together with the dhcp.external parameter, the module does not create Ironic.

Prepare the following resources for TLS:

  • A Secret with the Ironic certificate. The Secret requirements are listed in the description of the provisioningTLS.certificateRef parameter. The certificate must be issued for the address from the provisioningNetwork.ipAddress parameter.
  • A BareMetalRamdiskImage resource with the IPA image.
  • A BareMetalIPXEFirmware resource with iPXE firmware for BIOS and UEFI x86_64. The firmware must trust the CA from the ca.crt key of the Secret, because iPXE downloads files from Ironic over HTTPS. The firmware itself must be available over HTTPS on a server whose certificate is issued by the same CA.

Specify these resources in the provisioningTLS.certificateRef, ramdiskImageRef, and ipxeFirmwareRef parameters. The module creates Ironic only when all three resources exist and the Secret meets the requirements.

Do not delete the resources specified in the TLS parameters while these parameters are set. If any of the resources becomes unavailable, the module deletes Ironic, and server boot stops.

An example of TLS setup is provided on the “Examples” page.