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