1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/machineset-yaml-vsphere.adoc
2025-06-09 17:23:08 +00:00

147 lines
5.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * machine_management/creating-infrastructure-machinesets.adoc
// * machine_management/creating_machinesets/creating-machineset-vsphere.adoc
ifeval::["{context}" == "creating-infrastructure-machinesets"]
:infra:
endif::[]
:_mod-docs-content-type: REFERENCE
[id="machineset-yaml-vsphere_{context}"]
= Sample YAML for a compute machine set custom resource on vSphere
This sample YAML defines a compute machine set that runs on VMware vSphere and creates nodes that are labeled with
ifndef::infra[`node-role.kubernetes.io/<role>: ""`.]
ifdef::infra[`node-role.kubernetes.io/infra: ""`.]
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
ifndef::infra[`<role>`]
ifdef::infra[`infra`]
is the node label to add.
[source,yaml]
----
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
creationTimestamp: null
labels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
ifndef::infra[]
name: <infrastructure_id>-<role> <2>
endif::infra[]
ifdef::infra[]
name: <infrastructure_id>-infra <2>
endif::infra[]
namespace: openshift-machine-api
spec:
replicas: 1
selector:
matchLabels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
ifndef::infra[]
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>
endif::infra[]
ifdef::infra[]
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra
endif::infra[]
template:
metadata:
creationTimestamp: null
labels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
ifndef::infra[]
machine.openshift.io/cluster-api-machine-role: <role> <3>
machine.openshift.io/cluster-api-machine-type: <role>
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>
endif::infra[]
ifdef::infra[]
machine.openshift.io/cluster-api-machine-role: infra <3>
machine.openshift.io/cluster-api-machine-type: infra
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra
endif::infra[]
spec:
metadata:
creationTimestamp: null
labels:
ifndef::infra[]
node-role.kubernetes.io/<role>: ""
endif::infra[]
ifdef::infra[]
node-role.kubernetes.io/infra: ""
endif::infra[]
providerSpec:
value:
apiVersion: machine.openshift.io/v1beta1
credentialsSecret:
name: vsphere-cloud-credentials
dataDisks: <4>
- name: "<disk_name>"
provisioningMode: "<mode>"
sizeGiB: 20
diskGiB: 120
kind: VSphereMachineProviderSpec
memoryMiB: 8192
metadata:
creationTimestamp: null
network:
devices:
- networkName: "<vm_network_name>" <5>
numCPUs: 4
numCoresPerSocket: 1
snapshot: ""
template: <vm_template_name> <6>
userDataSecret:
name: worker-user-data
workspace:
datacenter: <vcenter_data_center_name> <7>
datastore: <vcenter_datastore_name> <8>
folder: <vcenter_vm_folder_path> <9>
resourcepool: <vsphere_resource_pool> <10>
server: <vcenter_server_ip> <11>
ifdef::infra[]
taints: <12>
- key: node-role.kubernetes.io/infra
effect: NoSchedule
endif::infra[]
----
<1> 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:
+
[source,terminal]
----
$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
----
ifndef::infra[]
<2> Specify the infrastructure ID and node label.
<3> Specify the node label to add.
endif::infra[]
ifdef::infra[]
<2> Specify the infrastructure ID and `infra` node label.
<3> Specify the `infra` node label.
endif::infra[]
<4> Specify one or more data disk definitions.
For more information, see "Configuring data disks by using machine sets".
<5> 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.
<6> Specify the vSphere VM template to use, such as `user-5ddjd-rhcos`.
<7> Specify the vCenter datacenter to deploy the compute machine set on.
<8> Specify the vCenter datastore to deploy the compute machine set on.
<9> Specify the path to the vSphere VM folder in vCenter, such as `/dc1/vm/user-inst-5ddjd`.
<10> Specify the vSphere resource pool for your VMs.
<11> Specify the vCenter server IP or fully qualified domain name.
ifdef::infra[]
<12> Specify a taint to prevent user workloads from being scheduled on infra nodes.
+
[NOTE]
====
After adding the `NoSchedule` taint on the infrastructure node, existing DNS pods running on that node are marked as `misscheduled`. You must either delete or link:https://access.redhat.com/solutions/6592171[add toleration on `misscheduled` DNS pods].
====
endif::infra[]
ifeval::["{context}" == "creating-infrastructure-machinesets"]
:!infra:
endif::[]
ifeval::["{context}" == "cluster-tasks"]
:!infra:
endif::[]