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.

Creating a node with Ironic in the cluster

In this example, Ironic runs in the cluster with the built-in DHCP server, and one CloudEphemeral node is created on a physical server. Replace the addresses, credentials, server UUID, and image data with values of your environment.

  1. Enable the module and configure Ironic:

    apiVersion: deckhouse.io/v1alpha1
    kind: ModuleConfig
    metadata:
      name: infra-provider-baremetal
    spec:
      enabled: true
      version: 1
      settings:
        nodes:
          parameters:
            ironic:
              provisioningNetwork:
                interface: enp7s0
                ipAddress: 192.168.223.85
              dhcp:
                internal:
                  networkCIDR: 192.168.223.0/24
                  rangeBegin: 192.168.223.160
                  rangeEnd: 192.168.223.171
                  gatewayAddress: 192.168.223.254
                  dnsAddress: 192.168.223.1
    
  2. Create a Secret with credentials of the server baseboard management controller (BMC) and a BareMetalInstance resource that describes the server:

    apiVersion: v1
    kind: Secret
    metadata:
      name: worker-01-bmc
      namespace: d8-infra-provider-baremetal
    type: cloud-provider.deckhouse.io/credentials
    stringData:
      authScheme: userPassword
      identity: <BMC_USER>
      secret: <BMC_PASSWORD>
    ---
    apiVersion: deckhouse.io/v1
    kind: BareMetalInstance
    metadata:
      name: worker-01
      labels:
        pool: workers
    spec:
      bootMACAddress: "f0:3f:03:01:1d:22"
      bmc:
        ipAddress: 192.168.201.32
        systemUUID: "00583f1d-2903-e203-0010-d21de0c7571b"
        credentialsRef:
          namespace: d8-infra-provider-baremetal
          kind: Secret
          name: worker-01-bmc
    

    Replace <BMC_USER> and <BMC_PASSWORD> with the BMC user name and password. The instance class from the fourth step selects the server by the pool: workers label.

  3. Wait until the server moves to the available state:

    d8 k get baremetalinstances worker-01
    
  4. Create a BareMetalImage resource with the operating system image and a BareMetalInstanceClass resource with node parameters:

    apiVersion: deckhouse.io/v1
    kind: BareMetalImage
    metadata:
      name: ubuntu-24-04-amd64
    spec:
      direct:
        url: http://images.example.com/ubuntu-24.04-amd64.qcow2
        checksum: 6695ad25a7a930accfd1e004f151578c4152338191eb7598fd89745ab93d3160
        checksumType: sha256
        format: qcow2
    ---
    apiVersion: deckhouse.io/v1
    kind: BareMetalInstanceClass
    metadata:
      name: workers
    spec:
      imageRef:
        kind: BareMetalImage
        name: ubuntu-24-04-amd64
      hostSelector:
        matchLabels:
          pool: workers
      capacity:
        cpu: "4"
        memory: 8Gi
    
  5. Create a NodeGroup with the CloudEphemeral node type:

    apiVersion: deckhouse.io/v1
    kind: NodeGroup
    metadata:
      name: workers
    spec:
      nodeType: CloudEphemeral
      cloudInstances:
        minPerZone: 1
        maxPerZone: 1
        classReference:
          kind: BareMetalInstanceClass
          name: workers
    
  6. Check that the node has appeared in the cluster:

    d8 k get nodes -l node.deckhouse.io/group=workers
    

    Once Ironic installs the operating system and the server joins the cluster, the node appears in the command output.

Connecting to an external Ironic

In this example, the module connects to Ironic deployed outside the cluster, with password authentication and API certificate verification.

  1. Create a Secret with Ironic API credentials and a Secret with the CA certificate:

    d8 k -n d8-infra-provider-baremetal create secret generic ironic-credentials \
      --from-literal=identity=<IRONIC_USER> \
      --from-literal=secret=<IRONIC_PASSWORD>
    d8 k -n d8-infra-provider-baremetal create secret generic ironic-ca \
      --from-file=ca.crt=<CA_FILE>
    

    Replace <IRONIC_USER> and <IRONIC_PASSWORD> with the Ironic API user name and password, and <CA_FILE> with the path to the file with the CA certificate that signed the API certificate.

  2. Enable the module and set the connection settings in the externalInstance parameter:

    apiVersion: deckhouse.io/v1alpha1
    kind: ModuleConfig
    metadata:
      name: infra-provider-baremetal
    spec:
      enabled: true
      version: 1
      settings:
        nodes:
          parameters:
            ironic:
              externalInstance:
                endpoint: https://ironic.example.com:6385/v1/
                credentialsRef:
                  kind: Secret
                  name: ironic-credentials
                  namespace: d8-infra-provider-baremetal
                tls:
                  caCertRef:
                    kind: Secret
                    name: ironic-ca
                    namespace: d8-infra-provider-baremetal
                    key: ca.crt
    

Servers and nodes in this mode are created in the same way as in the previous example, starting from the second step.

Enabling TLS for server boot

In this example, the module protects server boot traffic with TLS. The example extends the settings from the first example.

  1. Create a Secret with the Ironic certificate and add a label to it:

    d8 k -n d8-infra-provider-baremetal create secret generic ironic-tls \
      --type=kubernetes.io/tls \
      --from-file=tls.crt=<CERT_FILE> \
      --from-file=tls.key=<KEY_FILE> \
      --from-file=ca.crt=<CA_FILE>
    d8 k -n d8-infra-provider-baremetal label secret ironic-tls \
      environment.metal3.io/ironic-standalone-operator=true
    

    Replace <CERT_FILE> and <KEY_FILE> with the paths to the Ironic certificate and its private key, and <CA_FILE> with the path to the CA certificate that issued the Ironic certificate.

  2. Create a BareMetalRamdiskImage resource with the Ironic Python Agent (IPA) image and a BareMetalIPXEFirmware resource with iPXE firmware:

    apiVersion: deckhouse.io/v1
    kind: BareMetalRamdiskImage
    metadata:
      name: ipa-tls
    spec:
      direct:
        kernelURL: https://images.example.com/ipa/ironic-python-agent.kernel
        initramfsURL: https://images.example.com/ipa/ironic-python-agent.initramfs
    ---
    apiVersion: deckhouse.io/v1
    kind: BareMetalIPXEFirmware
    metadata:
      name: ipxe-tls
    spec:
      direct:
        bios:
          url: https://images.example.com/ipxe/undionly.kpxe
          sha256: <BIOS_FIRMWARE_SHA256>
        uefiX86_64:
          url: https://images.example.com/ipxe/snponly.efi
          sha256: <UEFI_FIRMWARE_SHA256>
    

    Replace <BIOS_FIRMWARE_SHA256> and <UEFI_FIRMWARE_SHA256> with the lowercase SHA-256 checksums of the firmware files.

  3. Add the provisioningTLS, ramdiskImageRef, and ipxeFirmwareRef parameters to the module settings:

    apiVersion: deckhouse.io/v1alpha1
    kind: ModuleConfig
    metadata:
      name: infra-provider-baremetal
    spec:
      enabled: true
      version: 1
      settings:
        nodes:
          parameters:
            ironic:
              provisioningNetwork:
                interface: enp7s0
                ipAddress: 192.168.223.85
              dhcp:
                internal:
                  networkCIDR: 192.168.223.0/24
                  rangeBegin: 192.168.223.160
                  rangeEnd: 192.168.223.171
              provisioningTLS:
                certificateRef:
                  name: ironic-tls
              ramdiskImageRef:
                kind: BareMetalRamdiskImage
                name: ipa-tls
              ipxeFirmwareRef:
                kind: BareMetalIPXEFirmware
                name: ipxe-tls
    
  4. Check that the module has created Ironic:

    d8 k -n d8-infra-provider-baremetal get ironics.ironic.metal3.io
    

    If the output has no ironic resource, check that all three resources from the TLS parameters are created and the Secret meets the requirements.