This section describes the Machine resource used in Mirantis Container Cloud API for bare metal provider. The Machine resource describes the machine-level parameters.

For demonstration purposes, the Container Cloud Machine custom resource (CR) is split into the following major sections:


The Container Cloud Machine CR contains the following fields:

  • apiVersion

    API version of the object that is

  • kind

    Object type that is Machine.

The metadata object field of the Machine resource contains the following fields:

  • name

    Name of the Machine object.

  • namespace

    Project in which the Machine object is created.

  • annotations

    Key-value pair to attach arbitrary metadata to the object:


      Annotation attached to the Machine object to reference the corresponding BareMetalHost object in the <BareMetalHostProjectName/BareMetalHostName> format.

  • labels

    Key-value pairs that are attached to the object:


      Provider type that matches the provider type in the Cluster object and must be baremetal.


      Region name that matches the region name in the Cluster object.


      Cluster name that the Machine object is linked to.


      For the control plane role of a machine, this label contains any value, for example, "true". For the worker role, this label is absent.

    • (optional) Available since 2.17.0

      Name of the MachinePool object to which this machine is assigned to. If the machine is not assigned to any machine pool, this label is absent.


    Labels and annotations that are not documented in this API Reference are generated automatically by Container Cloud. Do not modify them using the Container Cloud API.

Configuration example:

kind: Machine
  name: example-control-plane
  namespace: example-ns
  annotations: default/master-0
  labels: baremetal region-one example-cluster "true" # remove for worker

spec:providerSpec for instance configuration


If a machine is assigned to a machine pool, the providerSpec section of the specific Machine object automatically updates during pool configuration. The only providerSpec field that is not overwritten automatically is maintenance. Do not edit other fields of this section manually.

The spec object field of the Machine object represents the BareMetalMachineProviderSpec subresource with all required details to create a bare metal instance. It contains the following fields:

  • apiVersion

    API version of the object that is

  • kind

    Object type that is BareMetalMachineProviderSpec.

  • bareMetalHostProfile

    Configuration profile of a bare metal host:

    • name

      Name of a bare metal host profile

    • namespace

      Project in which the bare metal host profile is created.

  • l2TemplateIfMappingOverride

    If specified, overrides the interface mapping value for the corresponding L2Template object.

  • l2TemplateSelector

    If specified, contains the name (first priority) or label of the L2 template that will be applied during a machine creation. The l2TemplateSelector field is copied from the Machine providerSpec object to the IpamHost object only once, during a machine creation. To modify l2TemplateSelector after creation of a Machine CR, edit the IpamHost object.

  • hostSelector

    Specifies the matching criteria for labels on the bare metal hosts. Limits the set of the BareMetalHost objects considered for claiming for the Machine object. The following selector labels can be added when creating a machine using the Container Cloud web UI:




    Any custom label that is assigned to one or more bare metal hosts using API can be used as a host selector. If the BareMetalHost objects with the specified label are missing, the Machine object will not be deployed until at least one bare metal host with the specified label is available.

  • nodeLabels

    List of node labels to be attached to a node for the user to run certain components on separate cluster nodes. The list of allowed node labels is located in the Cluster object status providerStatus.releaseRef.current.allowedNodeLabels field.

    Starting from Container Cloud 2.17.0, if the value field is not defined in allowedNodeLabels, a label can have any value.

    Before or after a machine deployment, add the required label from the allowed node labels list with the corresponding value to spec.providerSpec.value.nodeLabels in machine.yaml. For example:

    - key: stacklight
      value: enabled

    The addition of a node label that is not available in the list of allowed node labels is restricted.

  • distribution Mandatory since 2.16.0

    Specifies an operating system (OS) distribution ID that is present in the current ClusterRelease object under the AllowedDistributions list. When specified, the BareMetalHost object linked to this Machine object will be provisioned using the selected OS distribution instead of the default one. Starting from Container Cloud 2.17.0 ubuntu/focal is installed by default on non-MOSK-based clusters.


    Support for ubuntu/focal on MOSK-based Cluster releases will be added in one of the following Container Cloud releases.

    The default distribution is marked with the boolean flag default inside one of the elements under the AllowedDistributions list.

  • maintenance

    Maintenance mode of a machine. If enabled, the node of the selected machine is drained, cordoned, and prepared for maintenance operations.

Configuration example:

      kind: BareMetalMachineProviderSpec
        name: default
        namespace: default
        - eno1
        - enp0s0
        label: l2-template1-label-1
          baremetal: hw-master-0
      kind: BareMetalMachineProviderSpec
      - key: stacklight
        value: enabled
      distribution: ubuntu/focal

Machine status

The status object field of the Machine object represents the BareMetalMachineProviderStatus subresource that describes the current bare metal instance state and contains the following fields:

  • apiVersion

    API version of the object that is

  • kind

    Object type that is BareMetalMachineProviderStatus.

  • hardware

    Provides a machine hardware information:

    • cpu

      Number of CPUs.

    • ram

      RAM capacity in GB.

    • storage

      List of hard drives mounted on the machine. Contains the disk name and size in GB.

  • status

    Represents the current status of a machine:

    • Provision

      A machine is yet to obtain a status

    • Uninitialized

      A machine is yet to obtain the node IP address and host name

    • Pending

      A machine is yet to receive the deployment instructions and it is either not booted yet or waits for the LCM controller to be deployed

    • Prepare

      A machine is running the Prepare phase during which Docker images and packages are being predownloaded

    • Deploy

      A machine is processing the LCM controller instructions

    • Reconfigure

      A machine is being updated with a configuration without affecting workloads running on the machine

    • Ready

      A machine is deployed and the supported Mirantis Kubernetes Engine (MKE) version is set

    • Maintenance

      A machine host is cordoned, drained, and prepared for maintenance operations

  • maintenance

    Maintenance mode of a machine. If enabled, the node of the selected machine is drained, cordoned, and prepared for maintenance operations.

Configuration example:

    kind: BareMetalMachineProviderStatus
      cpu: 11
      ram: 16
      - name: /dev/vda
        size: 61
      - name: /dev/vdb
        size: 32
      - name: /dev/vdc
        size: 32
    status: Ready