Skip to content

Commit b300bee

Browse files
authored
Merge pull request #93582 from jeana-redhat/Move-taints-to-end-vSphere-machine-set
Simplify and deduplicate vSphere machineset wrt infra
2 parents 5dbf1b1 + 9e8d216 commit b300bee

File tree

1 file changed

+21
-43
lines changed

1 file changed

+21
-43
lines changed

modules/machineset-yaml-vsphere.adoc

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ifdef::infra[`node-role.kubernetes.io/infra: ""`.]
1717

1818
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
1919
ifndef::infra[`<role>`]
20-
ifdef::infra[`<infra>`]
20+
ifdef::infra[`infra`]
2121
is the node label to add.
2222

2323
[source,yaml]
@@ -39,40 +39,37 @@ spec:
3939
replicas: 1
4040
selector:
4141
matchLabels:
42-
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
42+
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
4343
ifndef::infra[]
44-
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role> <2>
44+
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>
4545
endif::infra[]
4646
ifdef::infra[]
47-
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra <2>
47+
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra
4848
endif::infra[]
4949
template:
5050
metadata:
5151
creationTimestamp: null
5252
labels:
53-
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
53+
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
5454
ifndef::infra[]
5555
machine.openshift.io/cluster-api-machine-role: <role> <3>
56-
machine.openshift.io/cluster-api-machine-type: <role> <3>
57-
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role> <2>
56+
machine.openshift.io/cluster-api-machine-type: <role>
57+
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>
5858
endif::infra[]
5959
ifdef::infra[]
60-
machine.openshift.io/cluster-api-machine-role: <infra> <3>
61-
machine.openshift.io/cluster-api-machine-type: <infra> <3>
62-
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra <2>
60+
machine.openshift.io/cluster-api-machine-role: infra <3>
61+
machine.openshift.io/cluster-api-machine-type: infra
62+
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra
6363
endif::infra[]
6464
spec:
6565
metadata:
6666
creationTimestamp: null
6767
labels:
6868
ifndef::infra[]
69-
node-role.kubernetes.io/<role>: "" <3>
69+
node-role.kubernetes.io/<role>: ""
7070
endif::infra[]
7171
ifdef::infra[]
72-
node-role.kubernetes.io/infra: "" <3>
73-
taints: <4>
74-
- key: node-role.kubernetes.io/infra
75-
effect: NoSchedule
72+
node-role.kubernetes.io/infra: ""
7673
endif::infra[]
7774
providerSpec:
7875
value:
@@ -86,16 +83,10 @@ endif::infra[]
8683
creationTimestamp: null
8784
network:
8885
devices:
89-
ifndef::infra[]
9086
- networkName: "<vm_network_name>" <4>
91-
endif::infra[]
92-
ifdef::infra[]
93-
- networkName: "<vm_network_name>" <5>
94-
endif::infra[]
9587
numCPUs: 4
9688
numCoresPerSocket: 1
9789
snapshot: ""
98-
ifndef::infra[]
9990
template: <vm_template_name> <5>
10091
userDataSecret:
10192
name: worker-user-data
@@ -105,17 +96,10 @@ ifndef::infra[]
10596
folder: <vcenter_vm_folder_path> <8>
10697
resourcepool: <vsphere_resource_pool> <9>
10798
server: <vcenter_server_ip> <10>
108-
endif::infra[]
10999
ifdef::infra[]
110-
template: <vm_template_name> <6>
111-
userDataSecret:
112-
name: worker-user-data
113-
workspace:
114-
datacenter: <vcenter_data_center_name> <7>
115-
datastore: <vcenter_datastore_name> <8>
116-
folder: <vcenter_vm_folder_path> <9>
117-
resourcepool: <vsphere_resource_pool> <10>
118-
server: <vcenter_server_ip> <11>
100+
taints: <11>
101+
- key: node-role.kubernetes.io/infra
102+
effect: NoSchedule
119103
endif::infra[]
120104
----
121105
<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:
@@ -127,31 +111,25 @@ $ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
127111
ifndef::infra[]
128112
<2> Specify the infrastructure ID and node label.
129113
<3> Specify the node label to add.
114+
endif::infra[]
115+
ifdef::infra[]
116+
<2> Specify the infrastructure ID and `infra` node label.
117+
<3> Specify the `infra` node label.
118+
endif::infra[]
130119
<4> 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.
131120
<5> Specify the vSphere VM template to use, such as `user-5ddjd-rhcos`.
132121
<6> Specify the vCenter data center to deploy the compute machine set on.
133122
<7> Specify the vCenter datastore to deploy the compute machine set on.
134123
<8> Specify the path to the vSphere VM folder in vCenter, such as `/dc1/vm/user-inst-5ddjd`.
135124
<9> Specify the vSphere resource pool for your VMs.
136125
<10> Specify the vCenter server IP or fully qualified domain name.
137-
endif::infra[]
138126
ifdef::infra[]
139-
<2> Specify the infrastructure ID and `<infra>` node label.
140-
<3> Specify the `<infra>` node label.
141-
<4> Specify a taint to prevent user workloads from being scheduled on infra nodes.
127+
<11> Specify a taint to prevent user workloads from being scheduled on infra nodes.
142128
+
143129
[NOTE]
144130
====
145131
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].
146132
====
147-
148-
<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.
149-
<6> Specify the vSphere VM template to use, such as `user-5ddjd-rhcos`.
150-
<7> Specify the vCenter data center to deploy the compute machine set on.
151-
<8> Specify the vCenter datastore to deploy the compute machine set on.
152-
<9> Specify the path to the vSphere VM folder in vCenter, such as `/dc1/vm/user-inst-5ddjd`.
153-
<10> Specify the vSphere resource pool for your VMs.
154-
<11> Specify the vCenter server IP or fully qualified domain name.
155133
endif::infra[]
156134

157135
ifeval::["{context}" == "creating-infrastructure-machinesets"]

0 commit comments

Comments
 (0)