MachineRegistration reference

The MachineRegistration resource allows:

  • to configure the registration process
  • to provide OS installation parameters
  • to define the Elemental services enabled for the registering machine Once created it generates the registration URL used by nodes to register and start the machine onboarding process.

The MachineRegistration has a Ready condition which turns to true when the Elemental Operator has successfully generated the registration URL and an associated ServiceAccount. From this point on the target host can connect to the registration URL to kick off the provisioning process.

An HTTP GET request against the registration URL returns the registration file: a .yaml file containing the registration data (i.e., the spec:config:elemental:registration section from the just created MachineRegistration). The registration file contains all the required data to allow the target host to perform self registration and start the Elemental provisioning.

There are several keys that can be configured under a MachineRegistration resource spec.

MachineRegistration

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: my-nodes
  5. namespace: fleet-default
  6. spec:
  7. machineName: name
  8. machineInventoryLabels:
  9. label: value
  10. machineInventoryAnnotations:
  11. annotation: value
  12. config:
  13. cloud-config:
  14. ...
  15. elemental:
  16. registration:
  17. ...
  18. install:
  19. ...

config.cloud-config

Contains the cloud-configuration to be injected in the node. See the Cloud Config Reference for full information.

config.elemental.registration

Contains the configuration used for the connection and the initial registration to the Elemental Operator.

Supports the following values:

KeyTypeDefault valueDescription
urlstringemptyURL to connect to the Elemental Operator
ca-certstringemptyCA to validate the certificate provided by the server at ‘url’ (required if the certificate is not signed by a public CA)
no-smbiosboolfalseWhether SMBIOS data should be sent to the Elemental Operator (see the SMBIOS reference for more information)
no-toolkitboolfalseDisables the Elemental Toolkit support and allows registration of an unmanaged OS

MachineRegistration - 图1warning

The following values are for development purposes only.

KeyTypeDefault valueDescription
authstringtpmAuthentication method to use during registration, one of tpm, mac or sys-uuid. See Authentication for more information
emulate-tpmboolfalseThis will use software emulation of the TPM (required for hosts without TPM hardware)
emulated-tpm-seedint641Fixed seed to use with ‘emulate-tpm’. Set to -1 to get a random seed. See TPM for more information

config.elemental.install

Contains the installation configuration that would be applied via elemental-register --install when booted from an ISO and passed to elemental install

Supports the following values:

KeyTypeDefault valueDescription
firmwarestringefiFirmware to install (‘efi’ or ‘bios’)
devicestringemptyDevice to install the system to
device-selectorstringemptyRules for picking device to install the system to
no-formatboolfalseDon’t format disks. It is implied that COS_STATE, COS_RECOVERY, COS_PERSISTENT, COS_OEM partitions are already existing on the target disk
config-urlslistemptyCloud-init config files locations
isostringemptyPerforms an installation from the ISO url instead of the running ISO
system-uristringemptySets the system image source and its type (e.g. ‘docker:registry.org/image:tag’) instead of using the running ISO
debugboolfalseEnable debug output
ttystringemptyAdd named tty to grub
poweroffboolfalseShutdown the system after install
rebootboolfalseReboot the system after install
eject-cdboolfalseTry to eject the cd on reboot

MachineRegistration - 图2warning

In case of using both iso and system-uri the iso value takes precedence

It is only required to specify either the device or device-selector fields for a successful install, the rest of the parameters are all optional.

If both device and device-selector is specified the value of device is used and device-selector is ignored.

Example

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: my-nodes
  5. namespace: fleet-default
  6. spec:
  7. config:
  8. elemental:
  9. install:
  10. device: /dev/sda
  11. debug: true
  12. reboot: true
  13. eject-cd: true
  14. system-uri: registry.suse.com/rancher/sle-micro/5.5:latest

config.elemental.install.device-selector

The device-selector field can be used to dynamically pick device during installation. The field contains a list of rules that looks like the following:

Example device-selector based on device name

  1. device-selector:
  2. - key: Name
  3. operator: In
  4. values:
  5. - /dev/sda
  6. - /dev/vda
  7. - /dev/nvme0

Example device-selector based on device size

  1. device-selector:
  2. - key: Size
  3. operator: Lt
  4. values:
  5. - 100Gi
  6. - key: Size
  7. operator: Gt
  8. values:
  9. - 30Gi

The currently supported operators are:

OperatorDescription
InThe key matches one of the provided values
NotInThe key does not match any of the provided values
GtThe key is greater than a single provided value
LtThe key is lesser than a single provided value

The currently supported keys are:

KeyDescription
NameThe device name (eg. /dev/sda)
SizeThe device size (values can be specified using kubernetes resources, eg 100Gi)

The rules are AND:ed together, which means all rules must match the targeted device.

config.elemental.reset

Contains the reset configuration that would be applied via elemental-register --reset, when booted from the recovery partition and passed to elemental reset

Supports the following values:

KeyTypeDefault valueDescription
enabledboolfalseMachineInventories created from this MachineRegistration will have reset functionality enabled
reset-persistentbooltrueFormat the COS_PERSISTENT partition
reset-oembooltrueFormat the COS_OEM partition
config-urlslistemptyCloud-init config files
system-uristringemptySets the system image source and its type (e.g. ‘docker:registry.org/image:tag’) instead of using the running ISO
debugboolfalseEnable debug output
poweroffboolfalseShutdown the system after reset
rebootbooltrueReboot the system after reset

Example

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: my-nodes
  5. namespace: fleet-default
  6. spec:
  7. config:
  8. elemental:
  9. reset:
  10. enabled: true
  11. debug: true
  12. reset-persistent: true
  13. reset-oem: true
  14. reboot: true
  15. system-uri: registry.suse.com/rancher/sle-micro/5.5:latest

machineName

This refers to the name that will be set to the node and the kubernetes resources that require a hostname (rke2 deployed pods for example, they use the node hostname as part of the pod names) String type.

MachineRegistration - 图3info

When elemental:registration:no-smbios is set to false (default), machineName is interpolated with SMBIOS data which allows you to store hardware information. See our SMBIOS docs for more information. If no machineName is specified, a default one in the form m-$UUID will be set. The UUID will be retrieved from the SMBIOS data if available, otherwise a random UUID will be generated.

Example

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: my-nodes
  5. namespace: fleet-default
  6. spec:
  7. machineName: hostname-test-4

machineInventoryLabels

Labels that will be set to the MachineInventory that is created from this MachineRegistration Key: value type. These labels will be used to establish a selection criteria in MachineInventorySelectorTemplate.

Elemental nodes will run elemental-register every 24 hours.
It is possible to update the machineInventoryLabels so that all registered nodes will apply the new labels on the next successfull registration update.

MachineRegistration - 图4info

When elemental:registration:no-smbios is set to false (default), Labels are interpolated with SMBIOS data. This allows to store hardware information in custom labels. See our SMBIOS docs for more information.

Example

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: my-nodes
  5. namespace: fleet-default
  6. spec:
  7. machineInventoryLabels:
  8. my.prefix.io/element: fire
  9. my.prefix.io/cpus: 32
  10. my.prefix.io/manufacturer: "${System Information/Manufacturer}"
  11. my.prefix.io/productName: "${System Information/Product Name}"
  12. my.prefix.io/serialNumber: "${System Information/Serial Number}"
  13. my.prefix.io/machineUUID: "${System Information/UUID}"

machineInventoryAnnotations

Annotations that will be set to the MachineInventory that is created from this MachineRegistration Key: value type

Example

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: my-nodes
  5. namespace: fleet-default
  6. spec:
  7. machineInventoryAnnotations:
  8. owner: bob
  9. version: 1.0.0