Available since 2.17.0
This section describes the
MachinePool resource used in the Container
Cloud API for all types of supported cloud providers.
MachinePool resource describes the parameters of a machine pool
and machines assigned to it.
For demonstration purposes, the Container Cloud
custom resource (CR) can be split into the following major sections:
The Container Cloud
MachinePool custom resource (CR) contains the following
Object type that is
metadata object field of the
MachinePool resource contains
the following fields:
Name of the
Container Cloud project in which the
MachinePoolobject has been created. Any machine assigned to this machine pool will be created in the same project.
Key-value pairs attached to the object:
Provider type that matches the provider type in the
Region name that matches the region name in the
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,
For the worker role, this label is absent.
Machines assigned to a machine pool have the same
labelsas their machine pool.
apiVersion: kaas.mirantis.com/v1alpha1 kind: MachinePool metadata: name: example-control-plane namespace: example-ns labels: kaas.mirantis.com/provider: openstack kaas.mirantis.com/region: eu cluster.sigs.k8s.io/cluster-name: example-cluster cluster.sigs.k8s.io/control-plane: "true" # remove for pool of workers
spec field of the
MachinePool object contains the following fields:
Policy used to identify nodes for deletion when downscaling. Defaults to
never, which is currently the only supported value.
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.
Value used to fill the
specfield of machines created for the machine pool. The field is provider-specific, for details see the
Machineobject API documentation of a particular provider.
MachinePoolobject causes the corresponding change in the spec of every machine assigned to the pool. Therefore, edit it with caution.
Configuration example (OpenStack):
spec: deletePolicy: never replicas: 3 machineSpec: #here goes example spec for an OpenStack machine providerSpec: value: apiVersion: openstackproviderconfig.k8s.io/v1alpha1 kind: OpenstackMachineProviderSpec availabilityZone: nova flavor: kaas.small image: bionic-server-cloudimg-amd64-20200724 securityGroups: - kaas-sg-ctrl-abcdefgh-0123-4567-890a-0a1b2c3d4e5f - kaas-sg-glob-abcdefgh-0123-4567-890a-0a1b2c3d4e5f nodeLabels: - displayName: Stacklight key: stacklight value: enabled
status field of the
MachinePool object contains the following
Most recent observed number of machines assigned to the machine pool.
Number of ready machines assigned to the machine pool.
status: readyReplicas: 3 replicas: 3