MachinePool resource

This section describes the MachinePool resource used in the Container Cloud API for all types of supported cloud providers. The MachinePool resource describes the parameters of a machine pool and machines assigned to it.

For demonstration purposes, the Container Cloud MachinePool custom resource (CR) can be split into the following major sections:


The Container Cloud MachinePool custom resource (CR) contains the following fields:

  • apiVersion

    Object API version that is

  • kind

    Object type that is MachinePool.

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

  • name

    Name of the MachinePool object.

  • namespace

    Container Cloud project in which the MachinePool object has been created. Any machine assigned to this machine pool will be created in the same project.

  • labels

    Key-value pairs attached to the object:


      Provider type that matches the provider type in the Cluster object.


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


      The label is removed from all Container Cloud objects in 2.26.0 (Cluster releases 17.1.0 and 16.1.0). Therefore, do not add the label starting these releases. On existing clusters updated to these releases, or if manually added, this label will be ignored by Container Cloud.


      Cluster name that this machine pool is linked to.


      • For the control plane role of machines assigned to the machine pool, this label contains any value, for example, "true".

      • For the worker role, this label is absent.

    Machines assigned to a machine pool have the same labels as their machine pool.

Configuration example:

kind: MachinePool
  name: example-control-plane
  namespace: example-ns
  labels: openstack example-cluster "true" # remove for pool of workers

MachinePool spec

The spec field of the MachinePool object contains the following fields:

  • deletePolicy

    Policy used to identify nodes for deletion when downscaling. Defaults to never, which is currently the only supported value.

  • replicas

    Required number of machines assigned to the machine pool.


    • Manually decrease replicas count when you unassign a machine from a pool with positive replicas count using the Container Cloud API.

    • If you decrease the replicas count, extra machines are not deleted automatically. Therefore, manually delete extra machines from the pool to match the decreased replicas count.

    • Deleting a machine assigned to a pool without decreasing replicas count causes automatic machine recreation.

    • If you increase the replicas count, additional machines are created automatically.

  • machineSpec

    Value used to fill the spec field of machines created for the machine pool. The field is provider-specific, for details see the Machine object API documentation of a particular provider.


    Changing machineSpec of the MachinePool object causes the corresponding change in the spec of every machine assigned to the pool. Therefore, edit it with caution.

Configuration example (OpenStack):

  deletePolicy: never
  replicas: 3
  machineSpec: #here goes example spec for an OpenStack machine
      kind: OpenstackMachineProviderSpec
      availabilityZone: nova
      flavor: kaas.small
      image: focal-server-cloudimg-amd64-20210810
        - kaas-sg-ctrl-abcdefgh-0123-4567-890a-0a1b2c3d4e5f
        - kaas-sg-glob-abcdefgh-0123-4567-890a-0a1b2c3d4e5f
      - displayName: Stacklight
        key: stacklight
        value: enabled

MachinePool status

The status field of the MachinePool object contains the following fields:

  • replicas

    Most recent observed number of machines assigned to the machine pool.

  • readyReplicas

    Number of ready machines assigned to the machine pool.

Configuration example:

  readyReplicas: 3
  replicas: 3