This sample YAML defines a compute machine set that runs on VMware vSphere and creates nodes that are labeled with
node-role.kubernetes.io/<role>: ""
.
In this sample, <infrastructure_id>
is the infrastructure ID label that is based on the cluster ID that you set when you provisioned the cluster, and
<role>
is the node label to add.
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
creationTimestamp: null
labels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id> (1)
name: <infrastructure_id>-<role> (2)
namespace: openshift-machine-api
spec:
replicas: 1
selector:
matchLabels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id> (1)
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role> (2)
template:
metadata:
creationTimestamp: null
labels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id> (1)
machine.openshift.io/cluster-api-machine-role: <role> (3)
machine.openshift.io/cluster-api-machine-type: <role> (3)
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role> (2)
spec:
metadata:
creationTimestamp: null
labels:
node-role.kubernetes.io/<role>: "" (3)
providerSpec:
value:
apiVersion: machine.openshift.io/v1beta1
credentialsSecret:
name: vsphere-cloud-credentials
diskGiB: 120
kind: VSphereMachineProviderSpec
memoryMiB: 8192
metadata:
creationTimestamp: null
network:
devices:
- networkName: "<vm_network_name>" (4)
numCPUs: 4
numCoresPerSocket: 1
snapshot: ""
template: <vm_template_name> (5)
userDataSecret:
name: worker-user-data
workspace:
datacenter: <vcenter_data_center_name> (6)
datastore: <vcenter_datastore_name> (7)
folder: <vcenter_vm_folder_path> (8)
resourcepool: <vsphere_resource_pool> (9)
server: <vcenter_server_ip> (10)
-
Specify the infrastructure ID that is based on the cluster ID that you set when you provisioned the cluster. If you have the OpenShift CLI (
oc
) installed, you can obtain the infrastructure ID by running the following command:$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
-
Specify the infrastructure ID and node label.
-
Specify the node label to add.
-
Specify the vSphere VM network to deploy the compute machine set to. This VM network must be where other compute machines reside in the cluster.
-
Specify the vSphere VM template to use, such as
user-5ddjd-rhcos
. -
Specify the vCenter data center to deploy the compute machine set on.
-
Specify the vCenter datastore to deploy the compute machine set on.
-
Specify the path to the vSphere VM folder in vCenter, such as
/dc1/vm/user-inst-5ddjd
. -
Specify the vSphere resource pool for your VMs.
-
Specify the vCenter server IP or fully qualified domain name.