@@ -35,44 +35,53 @@ end::MAPI[]
35
35
36
36
. List the compute machine sets in your cluster by running the following command:
37
37
+
38
+ tag::CAPI[]
38
39
[source,terminal]
39
40
----
40
- //tag::CAPI[]
41
41
$ 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
+ ----
44
47
$ oc get machinesets.machine.openshift.io -n openshift-machine-api
45
- //end::MAPI[]
46
48
----
49
+ end::MAPI[]
47
50
+
48
51
.Example output
52
+ tag::CAPI[]
49
53
[source,text]
50
54
----
51
- //tag::CAPI[]
52
55
NAME CLUSTER REPLICAS READY AVAILABLE AGE VERSION
53
56
<compute _machine_set_name_1 > <cluster _name > 1 1 1 26m
54
57
<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
+ ----
57
63
NAME DESIRED CURRENT READY AVAILABLE AGE
58
64
<compute _machine_set_name_1 > 1 1 1 1 55m
59
65
<compute _machine_set_name_2 > 1 1 1 1 55m
60
- //end::MAPI[]
61
66
----
67
+ end::MAPI[]
62
68
63
69
. Edit a compute machine set by running the following command:
64
70
+
71
+ tag::CAPI[]
65
72
[source,terminal]
66
73
----
67
- //tag::CAPI[]
68
74
$ oc edit machinesets.cluster.x-k8s.io <machine _set_name > \
69
75
-n openshift-cluster-api
70
- //end::CAPI[]
71
- //tag::MAPI[]
76
+ ----
77
+ end::CAPI[]
78
+ tag::MAPI[]
79
+ [source,terminal]
80
+ ----
72
81
$ oc edit machinesets.machine.openshift.io <machine _set_name > \
73
82
-n openshift-machine-api
74
- //end::MAPI[]
75
83
----
84
+ end::MAPI[]
76
85
77
86
. Note the value of the `spec.replicas` field, because you need it when scaling the machine set to apply the changes.
78
87
+
@@ -103,182 +112,217 @@ spec:
103
112
104
113
. List the machines that are managed by the updated compute machine set by running the following command:
105
114
+
115
+ tag::CAPI[]
106
116
[source,terminal]
107
117
----
108
- //tag::CAPI[]
109
118
$ oc get machines.cluster.x-k8s.io \
110
119
-n openshift-cluster-api \
111
120
-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
+ ----
114
126
$ oc get machines.machine.openshift.io \
115
127
-n openshift-machine-api \
116
128
-l machine.openshift.io/cluster-api-machineset=<machine _set_name >
117
- //end::MAPI[]
118
129
----
130
+ end::MAPI[]
119
131
+
120
132
.Example output for an AWS cluster
133
+ tag::CAPI[]
121
134
[source,text]
122
135
----
123
- //tag::CAPI[]
124
136
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
125
137
<machine _name_original_1 > <cluster _name > <original _1_ip >.<region >.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 4h
126
138
<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
+ ----
129
144
NAME PHASE TYPE REGION ZONE AGE
130
145
<machine _name_original_1 > Running m6i.xlarge us-west-1 us-west-1a 4h
131
146
<machine _name_original_2 > Running m6i.xlarge us-west-1 us-west-1a 4h
132
- //end::MAPI[]
133
147
----
148
+ end::MAPI[]
134
149
135
150
. For each machine that is managed by the updated compute machine set, set the `delete` annotation by running the following command:
136
151
+
152
+ tag::CAPI[]
137
153
[source,terminal]
138
154
----
139
- //tag::CAPI[]
140
155
$ oc annotate machines.cluster.x-k8s.io/<machine _name_original_1 > \
141
156
-n openshift-cluster-api \
142
157
cluster.x-k8s.io/delete-machine="true"
143
- //end::CAPI[]
144
- //tag::MAPI[]
158
+ ----
159
+ end::CAPI[]
160
+ tag::MAPI[]
161
+ [source,terminal]
162
+ ----
145
163
$ oc annotate machine.machine.openshift.io/<machine _name_original_1 > \
146
164
-n openshift-machine-api \
147
165
machine.openshift.io/delete-machine="true"
148
- //end::MAPI[]
149
166
----
167
+ end::MAPI[]
150
168
151
169
. To create replacement machines with the new configuration, scale the compute machine set to twice the number of replicas by running the following command:
152
170
+
171
+ tag::CAPI[]
153
172
[source,terminal]
154
173
----
155
174
$ oc scale -- replicas=4 \// <1>
156
- //tag::CAPI[]
157
175
machinesets.cluster.x-k8s.io <machine _set_name > \
158
176
-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>
161
183
machineset.machine.openshift.io <machine _set_name > \
162
184
-n openshift-machine-api
163
- //end::MAPI[]
164
185
----
186
+ end::MAPI[]
165
187
<1> The original example value of `2` is doubled to `4` .
166
188
167
189
. List the machines that are managed by the updated compute machine set by running the following command:
168
190
+
191
+ tag::CAPI[]
169
192
[source,terminal]
170
193
----
171
- //tag::CAPI[]
172
194
$ oc get machines.cluster.x-k8s.io \
173
195
-n openshift-cluster-api \
174
196
-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
+ ----
177
202
$ oc get machines.machine.openshift.io \
178
203
-n openshift-machine-api \
179
204
-l machine.openshift.io/cluster-api-machineset=<machine _set_name >
180
- //end::MAPI[]
181
205
----
206
+ end::MAPI[]
182
207
+
183
208
.Example output for an AWS cluster
209
+ tag::CAPI[]
184
210
[source,text]
185
211
----
186
- //tag::CAPI[]
187
212
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
188
213
<machine _name_original_1 > <cluster _name > <original _1_ip >.<region >.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 4h
189
214
<machine _name_original_2 > <cluster _name > <original _2_ip >.<region >.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 4h
190
215
<machine _name_updated_1 > <cluster _name > <updated _1_ip >.<region >.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Provisioned 55s
191
216
<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
+ ----
194
222
NAME PHASE TYPE REGION ZONE AGE
195
223
<machine _name_original_1 > Running m6i.xlarge us-west-1 us-west-1a 4h
196
224
<machine _name_original_2 > Running m6i.xlarge us-west-1 us-west-1a 4h
197
225
<machine _name_updated_1 > Provisioned m6i.xlarge us-west-1 us-west-1a 55s
198
226
<machine _name_updated_2 > Provisioning m6i.xlarge us-west-1 us-west-1a 55s
199
- //end::MAPI[]
200
227
----
228
+ end::MAPI[]
201
229
+
202
230
When the new machines are in the `Running` phase, you can scale the compute machine set to the original number of replicas.
203
231
204
232
. 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:
205
233
+
234
+ tag::CAPI[]
206
235
[source,terminal]
207
236
----
208
237
$ oc scale -- replicas=2 \// <1>
209
- //tag::CAPI[]
210
238
machinesets.cluster.x-k8s.io <machine _set_name > \
211
239
-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>
214
246
machineset.machine.openshift.io <machine _set_name > \
215
247
-n openshift-machine-api
216
- //end::MAPI[]
217
248
----
249
+ end::MAPI[]
218
250
<1> The original example value of `2` .
219
251
220
252
.Verification
221
253
222
254
* 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:
223
255
+
256
+ tag::CAPI[]
224
257
[source,terminal]
225
258
----
226
- //tag::CAPI[]
227
259
$ oc describe machines.cluster.x-k8s.io <machine_name_updated_1> \
228
260
-n openshift-cluster-api
229
- //end::CAPI[]
230
- //tag::MAPI[]
261
+ ----
262
+ end::CAPI[]
263
+ tag::MAPI[]
264
+ [source,terminal]
265
+ ----
231
266
$ oc describe machine.machine.openshift.io <machine_name_updated_1> \
232
267
-n openshift-machine-api
233
- //end::MAPI[]
234
268
----
269
+ end::MAPI[]
235
270
236
271
* 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:
237
272
+
273
+ tag::CAPI[]
238
274
[source,terminal]
239
275
----
240
- //tag::CAPI[]
241
276
$ oc get machines.cluster.x-k8s.io \
242
277
-n openshift-cluster-api \
243
278
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
+ ----
246
284
$ oc get machines.machine.openshift.io \
247
285
-n openshift-machine-api \
248
286
-l machine.openshift.io/cluster-api-machineset=<machine_set_name>
249
- //end::MAPI[]
250
287
----
288
+ end::MAPI[]
251
289
+
252
290
.Example output while deletion is in progress for an AWS cluster
291
+ tag::CAPI[]
253
292
[source,text]
254
293
----
255
- //tag::CAPI[]
256
294
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
257
295
<machine_name_original_1> <cluster_name> <original_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
258
296
<machine_name_original_2> <cluster_name> <original_2_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
259
297
<machine_name_updated_1> <cluster_name> <updated_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
260
298
<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
+ ----
263
304
NAME PHASE TYPE REGION ZONE AGE
264
305
<machine_name_original_1> Deleting m6i.xlarge us-west-1 us-west-1a 4h
265
306
<machine_name_original_2> Deleting m6i.xlarge us-west-1 us-west-1a 4h
266
307
<machine_name_updated_1> Running m6i.xlarge us-west-1 us-west-1a 5m41s
267
308
<machine_name_updated_2> Running m6i.xlarge us-west-1 us-west-1a 5m41s
268
- //end::MAPI[]
269
309
----
310
+ end::MAPI[]
270
311
+
271
312
.Example output when deletion is complete for an AWS cluster
313
+ tag::CAPI[]
272
314
[source,text]
273
315
----
274
- //tag::CAPI[]
275
316
NAME CLUSTER NODENAME PROVIDERID PHASE AGE VERSION
276
317
<machine_name_updated_1> <cluster_name> <updated_1_ip>.<region>.compute.internal aws:///us-east-2a/i-04e7b2cbd61fd2075 Running 18m
277
318
<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
+ ----
280
324
NAME PHASE TYPE REGION ZONE AGE
281
325
<machine_name_updated_1> Running m6i.xlarge us-west-1 us-west-1a 6m30s
282
326
<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