Inventory Management

The Elemental operator can hold an inventory of machines and the mapping of the machine to it’s configuration and assigned cluster.

MachineInventory

The MachineInventory holds all the relevant information for a registered machine.
Upon successful registration, the MachineInventory will inherit all machineInventoryLabels defined in the related MachineRegistration.
Additionally, the machine annotations will also be updated on each successful registration.

By default, Elemental Teal machines will attempt a registration update every 24 hours to update labels and annotations.

Reference

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineInventory
  3. metadata:
  4. # Machine annotations can be useful to identify hosts
  5. annotations:
  6. elemental.cattle.io/auth: tpm
  7. elemental.cattle.io/registration-ip: 192.168.122.152
  8. labels:
  9. # A label inherited from the MachineRegistration definition
  10. element: fire
  11. # Generic SMBIOS labels that are typically populated with
  12. # the MachineRegister approach
  13. machineUUID: f266c64b-3972-40e7-9937-3dc4a311436c
  14. manufacturer: QEMU
  15. productName: Standard-PC-Q35-ICH9-2009
  16. serialNumber: Not-Specified
  17. # Custom labels can be applied to each MachineInventory
  18. myCustomLabel: foo
  19. name: m-479ab68e-00ff-4081-a731-5b1a76610289
  20. # The namespace must match the namespace of the cluster
  21. # assigned to the clusters.provisioning.cattle.io resource
  22. namespace: fleet-default
  23. # A reference to the MachineInventorySelector that links the
  24. # machine to a Cluster definition
  25. ownerReferences:
  26. - apiVersion: elemental.cattle.io/v1beta1
  27. controller: true
  28. kind: MachineInventorySelector
  29. name: fire-machine-selector-qcn7d
  30. uid: 0a1f751e-4ca9-4a0d-919a-97ba1f434d12
  31. spec:
  32. # The hash of the TPM EK public key. This is used if you are
  33. # using TPM2 to identifiy nodes. Nodes can report their TPM
  34. # hash by using the MachineRegistration.
  35. tpmHash: d68795c6192af9922692f050b...

MachineRegistration

MachineRegistration holds information on how to install, reset, and configure all connected Elemental Teal machines.

It’s possible to update the spec.machineInventoryLabels and spec.machineInventoryAnnotations and this will be applied to all registered machines. By default, Elemental Teal machines will attempt a registration update every 24 hours to update labels and annotations.

While it’s possible to modify the spec.config definition, updates to the spec.config will be ignored by machines that already completed installation. Machines that couldn’t complete the installation will try again every 30 minutes by reloading the remote MachineRegistration definition. This can be useful to correct spec.config mistakes that prevent successful installation (for ex. spec.config.elemental.install.device), without having to create a new MachineRegistration and a new ISO.

Reference

  1. apiVersion: elemental.cattle.io/v1beta1
  2. kind: MachineRegistration
  3. metadata:
  4. name: fire-nodes
  5. # The namespace must match the namespace of the cluster
  6. # assigned to the clusters.provisioning.cattle.io resource
  7. namespace: fleet-default
  8. spec:
  9. # The cloud config that will be used to provision the node
  10. config:
  11. cloud-config:
  12. users:
  13. - name: root
  14. passwd: root
  15. elemental:
  16. install:
  17. reboot: true
  18. device: /dev/sda
  19. debug: true
  20. reset:
  21. enabled: true
  22. debug: true
  23. reset-persistent: true
  24. reset-oem: true
  25. reboot: true
  26. # Labels to be added to the created MachineInventory object
  27. machineInventoryLabels:
  28. element: fire
  29. manufacturer: "${System Information/Manufacturer}"
  30. productName: "${System Information/Product Name}"
  31. serialNumber: "${System Information/Serial Number}"
  32. machineUUID: "${System Information/UUID}"
  33. # Annotations to be added to the created MachineInventory object
  34. machineInventoryAnnotations: {}