Skip to content

Commit f3e8f8b

Browse files
authored
Merge pull request #76636 from jeana-redhat/main
adoc tags troubleshooting: solution into `main`
2 parents 074f127 + 22ae439 commit f3e8f8b

File tree

3 files changed

+106
-59
lines changed

3 files changed

+106
-59
lines changed

machine_management/cluster_api_machine_management/cluster-api-managing-machines.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ include::modules/capi-modifying-machine-template.adoc[leveloffset=+1]
1818
* xref:../../machine_management/cluster_api_machine_management/cluster-api-managing-machines.adoc#machineset-modifying_cluster-api-managing-machines[Modifying a compute machine set by using the CLI]
1919
2020
//Modifying a compute machine set by using the CLI
21-
include::modules/machineset-modifying.adoc[leveloffset=+1,tags=!*;CAPI]
21+
//tags exclude MAPI, leaving untagged + CAPI
22+
include::modules/machineset-modifying.adoc[leveloffset=+1,tag=!MAPI]
2223
[role="_additional-resources"]
2324
.Additional resources
2425
* xref:../../machine_management/cluster_api_machine_management/cluster_api_provider_configurations/cluster-api-config-options-aws.adoc#capi-yaml-machine-set-aws_cluster-api-config-options-aws[Sample YAML for a Cluster API compute machine set resource on {aws-full}]

machine_management/modifying-machineset.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ You can modify a compute machine set, such as adding labels, changing the instan
1313
If you need to scale a compute machine set without making other changes, see xref:../machine_management/manually-scaling-machineset.adoc#manually-scaling-machineset[Manually scaling a compute machine set].
1414
====
1515

16-
include::modules/machineset-modifying.adoc[leveloffset=+1,tags=!*;MAPI]
16+
//Modifying a compute machine set by using the CLI
17+
//tags exclude CAPI, leaving untagged + MAPI
18+
include::modules/machineset-modifying.adoc[leveloffset=+1,tag=!CAPI]
1719

1820
[role="_additional-resources"]
1921
.Additional resources

modules/machineset-modifying.adoc

Lines changed: 101 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,44 +35,53 @@ end::MAPI[]
3535

3636
. List the compute machine sets in your cluster by running the following command:
3737
+
38+
tag::CAPI[]
3839
[source,terminal]
3940
----
40-
//tag::CAPI[]
4141
$ oc get machinesets.cluster.x-k8s.io -n openshift-cluster-api
42-
//end::CAPI[]
43-
//tag::MAPI[]
42+
----
43+
end::CAPI[]
44+
tag::MAPI[]
45+
[source,terminal]
46+
----
4447
$ oc get machinesets.machine.openshift.io -n openshift-machine-api
45-
//end::MAPI[]
4648
----
49+
end::MAPI[]
4750
+
4851
.Example output
52+
tag::CAPI[]
4953
[source,text]
5054
----
51-
//tag::CAPI[]
5255
NAME CLUSTER REPLICAS READY AVAILABLE AGE VERSION
5356
<compute_machine_set_name_1> <cluster_name> 1 1 1 26m
5457
<compute_machine_set_name_2> <cluster_name> 1 1 1 26m
55-
//end::CAPI[]
56-
//tag::MAPI[]
58+
----
59+
end::CAPI[]
60+
tag::MAPI[]
61+
[source,text]
62+
----
5763
NAME DESIRED CURRENT READY AVAILABLE AGE
5864
<compute_machine_set_name_1> 1 1 1 1 55m
5965
<compute_machine_set_name_2> 1 1 1 1 55m
60-
//end::MAPI[]
6166
----
67+
end::MAPI[]
6268

6369
. Edit a compute machine set by running the following command:
6470
+
71+
tag::CAPI[]
6572
[source,terminal]
6673
----
67-
//tag::CAPI[]
6874
$ oc edit machinesets.cluster.x-k8s.io <machine_set_name> \
6975
-n openshift-cluster-api
70-
//end::CAPI[]
71-
//tag::MAPI[]
76+
----
77+
end::CAPI[]
78+
tag::MAPI[]
79+
[source,terminal]
80+
----
7281
$ oc edit machinesets.machine.openshift.io <machine_set_name> \
7382
-n openshift-machine-api
74-
//end::MAPI[]
7583
----
84+
end::MAPI[]
7685

7786
. Note the value of the `spec.replicas` field, because you need it when scaling the machine set to apply the changes.
7887
+
@@ -103,182 +112,217 @@ spec:
103112

104113
. List the machines that are managed by the updated compute machine set by running the following command:
105114
+
115+
tag::CAPI[]
106116
[source,terminal]
107117
----
108-
//tag::CAPI[]
109118
$ oc get machines.cluster.x-k8s.io \
110119
-n openshift-cluster-api \
111120
-l cluster.x-k8s.io/set-name=<machine_set_name>
112-
//end::CAPI[]
113-
//tag::MAPI[]
121+
----
122+
end::CAPI[]
123+
tag::MAPI[]
124+
[source,terminal]
125+
----
114126
$ oc get machines.machine.openshift.io \
115127
-n openshift-machine-api \
116128
-l machine.openshift.io/cluster-api-machineset=<machine_set_name>
117-
//end::MAPI[]
118129
----
130+
end::MAPI[]
119131
+
120132
.Example output for an AWS cluster
133+
tag::CAPI[]
121134
[source,text]
122135
----
123-
//tag::CAPI[]
124136
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
125137
<machine_name_original_1> <cluster_name> <original_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 4h
126138
<machine_name_original_2> <cluster_name> <original_2_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 4h
127-
//end::CAPI[]
128-
//tag::MAPI[]
139+
----
140+
end::CAPI[]
141+
tag::MAPI[]
142+
[source,text]
143+
----
129144
NAME PHASE TYPE REGION ZONE AGE
130145
<machine_name_original_1> Running m6i.xlarge us-west-1 us-west-1a 4h
131146
<machine_name_original_2> Running m6i.xlarge us-west-1 us-west-1a 4h
132-
//end::MAPI[]
133147
----
148+
end::MAPI[]
134149

135150
. For each machine that is managed by the updated compute machine set, set the `delete` annotation by running the following command:
136151
+
152+
tag::CAPI[]
137153
[source,terminal]
138154
----
139-
//tag::CAPI[]
140155
$ oc annotate machines.cluster.x-k8s.io/<machine_name_original_1> \
141156
-n openshift-cluster-api \
142157
cluster.x-k8s.io/delete-machine="true"
143-
//end::CAPI[]
144-
//tag::MAPI[]
158+
----
159+
end::CAPI[]
160+
tag::MAPI[]
161+
[source,terminal]
162+
----
145163
$ oc annotate machine.machine.openshift.io/<machine_name_original_1> \
146164
-n openshift-machine-api \
147165
machine.openshift.io/delete-machine="true"
148-
//end::MAPI[]
149166
----
167+
end::MAPI[]
150168

151169
. To create replacement machines with the new configuration, scale the compute machine set to twice the number of replicas by running the following command:
152170
+
171+
tag::CAPI[]
153172
[source,terminal]
154173
----
155174
$ oc scale --replicas=4 \// <1>
156-
//tag::CAPI[]
157175
machinesets.cluster.x-k8s.io <machine_set_name> \
158176
-n openshift-cluster-api
159-
//end::CAPI[]
160-
//tag::MAPI[]
177+
----
178+
end::CAPI[]
179+
tag::MAPI[]
180+
[source,terminal]
181+
----
182+
$ oc scale --replicas=4 \// <1>
161183
machineset.machine.openshift.io <machine_set_name> \
162184
-n openshift-machine-api
163-
//end::MAPI[]
164185
----
186+
end::MAPI[]
165187
<1> The original example value of `2` is doubled to `4`.
166188

167189
. List the machines that are managed by the updated compute machine set by running the following command:
168190
+
191+
tag::CAPI[]
169192
[source,terminal]
170193
----
171-
//tag::CAPI[]
172194
$ oc get machines.cluster.x-k8s.io \
173195
-n openshift-cluster-api \
174196
-l cluster.x-k8s.io/set-name=<machine_set_name>
175-
//end::CAPI[]
176-
//tag::MAPI[]
197+
----
198+
end::CAPI[]
199+
tag::MAPI[]
200+
[source,terminal]
201+
----
177202
$ oc get machines.machine.openshift.io \
178203
-n openshift-machine-api \
179204
-l machine.openshift.io/cluster-api-machineset=<machine_set_name>
180-
//end::MAPI[]
181205
----
206+
end::MAPI[]
182207
+
183208
.Example output for an AWS cluster
209+
tag::CAPI[]
184210
[source,text]
185211
----
186-
//tag::CAPI[]
187212
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
188213
<machine_name_original_1> <cluster_name> <original_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 4h
189214
<machine_name_original_2> <cluster_name> <original_2_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 4h
190215
<machine_name_updated_1> <cluster_name> <updated_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Provisioned 55s
191216
<machine_name_updated_2> <cluster_name> <updated_2_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Provisioning 55s
192-
//end::CAPI[]
193-
//tag::MAPI[]
217+
----
218+
end::CAPI[]
219+
tag::MAPI[]
220+
[source,text]
221+
----
194222
NAME PHASE TYPE REGION ZONE AGE
195223
<machine_name_original_1> Running m6i.xlarge us-west-1 us-west-1a 4h
196224
<machine_name_original_2> Running m6i.xlarge us-west-1 us-west-1a 4h
197225
<machine_name_updated_1> Provisioned m6i.xlarge us-west-1 us-west-1a 55s
198226
<machine_name_updated_2> Provisioning m6i.xlarge us-west-1 us-west-1a 55s
199-
//end::MAPI[]
200227
----
228+
end::MAPI[]
201229
+
202230
When the new machines are in the `Running` phase, you can scale the compute machine set to the original number of replicas.
203231

204232
. To remove the machines that were created with the old configuration, scale the compute machine set to the original number of replicas by running the following command:
205233
+
234+
tag::CAPI[]
206235
[source,terminal]
207236
----
208237
$ oc scale --replicas=2 \// <1>
209-
//tag::CAPI[]
210238
machinesets.cluster.x-k8s.io <machine_set_name> \
211239
-n openshift-cluster-api
212-
//end::CAPI[]
213-
//tag::MAPI[]
240+
----
241+
end::CAPI[]
242+
tag::MAPI[]
243+
[source,terminal]
244+
----
245+
$ oc scale --replicas=2 \// <1>
214246
machineset.machine.openshift.io <machine_set_name> \
215247
-n openshift-machine-api
216-
//end::MAPI[]
217248
----
249+
end::MAPI[]
218250
<1> The original example value of `2`.
219251

220252
.Verification
221253

222254
* To verify that a machine created by the updated machine set has the correct configuration, examine the relevant fields in the CR for one of the new machines by running the following command:
223255
+
256+
tag::CAPI[]
224257
[source,terminal]
225258
----
226-
//tag::CAPI[]
227259
$ oc describe machines.cluster.x-k8s.io <machine_name_updated_1> \
228260
-n openshift-cluster-api
229-
//end::CAPI[]
230-
//tag::MAPI[]
261+
----
262+
end::CAPI[]
263+
tag::MAPI[]
264+
[source,terminal]
265+
----
231266
$ oc describe machine.machine.openshift.io <machine_name_updated_1> \
232267
-n openshift-machine-api
233-
//end::MAPI[]
234268
----
269+
end::MAPI[]
235270
236271
* To verify that the compute machines without the updated configuration are deleted, list the machines that are managed by the updated compute machine set by running the following command:
237272
+
273+
tag::CAPI[]
238274
[source,terminal]
239275
----
240-
//tag::CAPI[]
241276
$ oc get machines.cluster.x-k8s.io \
242277
-n openshift-cluster-api \
243278
cluster.x-k8s.io/set-name=<machine_set_name>
244-
//end::CAPI[]
245-
//tag::MAPI[]
279+
----
280+
end::CAPI[]
281+
tag::MAPI[]
282+
[source,terminal]
283+
----
246284
$ oc get machines.machine.openshift.io \
247285
-n openshift-machine-api \
248286
-l machine.openshift.io/cluster-api-machineset=<machine_set_name>
249-
//end::MAPI[]
250287
----
288+
end::MAPI[]
251289
+
252290
.Example output while deletion is in progress for an AWS cluster
291+
tag::CAPI[]
253292
[source,text]
254293
----
255-
//tag::CAPI[]
256294
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
257295
<machine_name_original_1> <cluster_name> <original_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
258296
<machine_name_original_2> <cluster_name> <original_2_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
259297
<machine_name_updated_1> <cluster_name> <updated_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
260298
<machine_name_updated_2> <cluster_name> <updated_2_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
261-
//end::CAPI[]
262-
//tag::MAPI[]
299+
----
300+
end::CAPI[]
301+
tag::MAPI[]
302+
[source,text]
303+
----
263304
NAME PHASE TYPE REGION ZONE AGE
264305
<machine_name_original_1> Deleting m6i.xlarge us-west-1 us-west-1a 4h
265306
<machine_name_original_2> Deleting m6i.xlarge us-west-1 us-west-1a 4h
266307
<machine_name_updated_1> Running m6i.xlarge us-west-1 us-west-1a 5m41s
267308
<machine_name_updated_2> Running m6i.xlarge us-west-1 us-west-1a 5m41s
268-
//end::MAPI[]
269309
----
310+
end::MAPI[]
270311
+
271312
.Example output when deletion is complete for an AWS cluster
313+
tag::CAPI[]
272314
[source,text]
273315
----
274-
//tag::CAPI[]
275316
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
276317
<machine_name_updated_1> <cluster_name> <updated_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
277318
<machine_name_updated_2> <cluster_name> <updated_2_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
278-
//end::CAPI[]
279-
//tag::MAPI[]
319+
----
320+
end::CAPI[]
321+
tag::MAPI[]
322+
[source,text]
323+
----
280324
NAME PHASE TYPE REGION ZONE AGE
281325
<machine_name_updated_1> Running m6i.xlarge us-west-1 us-west-1a 6m30s
282326
<machine_name_updated_2> Running m6i.xlarge us-west-1 us-west-1a 6m30s
283-
//end::MAPI[]
284-
----
327+
----
328+
end::MAPI[]

0 commit comments

Comments
 (0)