// Module included in the following assemblies: // // * machine_management/cluster_api_machine_management/cluster-api-using.adoc :_mod-docs-content-type: PROCEDURE [id="capi-creating-machine-set_{context}"] = Creating a Cluster API compute machine set You can create compute machine sets that use the Cluster API to dynamically manage the machine compute resources for specific workloads of your choice. .Prerequisites * You have deployed an {product-title} cluster. * You have enabled the use of the Cluster API. * You have access to the cluster using an account with `cluster-admin` permissions. * You have installed the {oc-first}. * You have created the machine template resource. .Procedure . Create a YAML file similar to the following. This procedure uses `.yaml` as an example file name. + -- [source,yaml] ---- apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineSet metadata: name: # <1> namespace: openshift-cluster-api spec: clusterName: # <2> replicas: 1 selector: matchLabels: test: example template: metadata: labels: test: example spec: # <3> # ... ---- <1> Specify a name for the compute machine set. The cluster ID, machine role, and region form a typical pattern for this value in the following format: `--`. <2> Specify the name of the cluster. Obtain the value of the cluster ID by running the following command: + [source,terminal] ---- $ oc get infrastructure cluster \ -o jsonpath='{.status.infrastructureName}' ---- <3> Specify the details for your environment. These parameters are provider specific. For more information, see the sample Cluster API compute machine set YAML for your provider. -- . Create the compute machine set CR by running the following command: + [source,terminal] ---- $ oc create -f .yaml ---- . Confirm that the compute machine set CR is created by running the following command: + [source,terminal] ---- $ oc get machineset.cluster.x-k8s.io -n openshift-cluster-api ---- + .Example output [source,text] ---- NAME CLUSTER REPLICAS READY AVAILABLE AGE VERSION 1 1 1 17m ---- + When the new compute machine set is available, the `REPLICAS` and `AVAILABLE` values match. If the compute machine set is not available, wait a few minutes and run the command again. .Verification * To verify that the compute machine set is creating machines according to your required configuration, review the lists of machines and nodes in the cluster by running the following commands: ** View the list of Cluster API machines: + [source,terminal] ---- $ oc get machine.cluster.x-k8s.io -n openshift-cluster-api ---- + .Example output [source,text] ---- NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION - ..compute.internal Running 8m23s ---- ** View the list of nodes: + [source,terminal] ---- $ oc get node ---- + .Example output [source,text] ---- NAME STATUS ROLES AGE VERSION ..compute.internal Ready worker 5h14m v1.28.5 ..compute.internal Ready master 5h19m v1.28.5 ..compute.internal Ready worker 7m v1.28.5 ----