Skip to content

Commit 67365b6

Browse files
authored
Merge pull request #76910 from mburke5678/mco-update-boot-images
Update boot images for GCP (tech preview)
2 parents 29458cf + 5e5cf77 commit 67365b6

File tree

4 files changed

+218
-0
lines changed

4 files changed

+218
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * post_installation_configuration/machine-configuration-tasks.adoc
4+
// * nodes/nodes-nodes-managing.adoc
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="mco-update-boot-images-disable_{context}"]
8+
= Disabling updated boot images
9+
10+
To disable the updated boot image feature, edit the `MachineConfiguration` object to remove the `managedBootImages` stanza.
11+
12+
If you disable this feature after some nodes have been created with the new boot image version, any existing nodes retain their current boot image. Turning off this feature does not rollback the nodes or machine sets to the originally-installed boot image. The machine sets retain the boot image version that was present when the feature was enabled and is not updated again when the cluster is upgraded to a new {product-title} version in the future.
13+
14+
.Procedure
15+
16+
. Disable updated boot images by editing the `MachineConfiguration` object:
17+
+
18+
[source,terminal]
19+
----
20+
$ oc edit MachineConfiguration cluster
21+
----
22+
23+
. Remove the `managedBootImages` stanza:
24+
+
25+
[source,yaml]
26+
----
27+
apiVersion: operator.openshift.io/v1
28+
kind: MachineConfiguration
29+
metadata:
30+
name: cluster
31+
namespace: openshift-machine-config-operator
32+
spec:
33+
# ...
34+
managedBootImages: <1>
35+
machineManagers:
36+
- resource: machinesets
37+
apiGroup: machine.openshift.io
38+
selection:
39+
mode: All
40+
----
41+
<1> Remove the entire stanza to disable updated boot images.

modules/mco-update-boot-images.adoc

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * post_installation_configuration/machine-configuration-tasks.adoc
4+
// * nodes/nodes-nodes-managing.adoc
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="mco-update-boot-images_{context}"]
8+
= Updating boot images
9+
10+
The Machine Config Operator (MCO) uses a boot image to bring up a {op-system-first} node. By default, {product-title} does not manage the boot image.
11+
12+
This means that the boot image in your cluster is not updated along with your cluster. For example, if your cluster was originally created with {product-title} 4.12, the boot image that the cluster uses to create nodes is the same 4.12 version, even if your cluster is at a later version. If the cluster is later upgraded to 4.13 or later, new nodes continue to scale with the same 4.12 image.
13+
14+
This process could cause the following issues:
15+
16+
* Extra time to start up nodes
17+
* Certificate expiration issues
18+
* Version skew issues
19+
20+
To avoid these issues, you can configure your cluster to update the boot image whenever you update your cluster. By modifying the `MachineConfiguration` object, you can enable this feature. Currently, the ability to update the boot image is available for only Google Cloud Platform (GCP) clusters and is not supported for Cluster CAPI Operator managed clusters.
21+
22+
:FeatureName: The updating boot image feature
23+
include::snippets/technology-preview.adoc[]
24+
25+
To view the current boot image used in your cluster, examine a machine set:
26+
27+
.Example machine set with the boot image reference
28+
29+
[source,yaml]
30+
----
31+
apiVersion: machine.openshift.io/v1beta1
32+
kind: MachineSet
33+
metadata:
34+
name: ci-ln-hmy310k-72292-5f87z-worker-a
35+
namespace: openshift-machine-api
36+
spec:
37+
# ...
38+
template:
39+
# ...
40+
spec:
41+
# ...
42+
providerSpec:
43+
# ...
44+
value:
45+
disks:
46+
- autoDelete: true
47+
boot: true
48+
image: projects/rhcos-cloud/global/images/rhcos-412-85-202203181601-0-gcp-x86-64 <1>
49+
# ...
50+
----
51+
<1> This boot image is the same as the originally-installed {product-title} version, in this example {product-title} 4.12, regardless of the current version of the cluster. The way that the boot image is represented in the machine set depends on the platform, as the structure of the `providerSpec` field differs from platform to platform.
52+
53+
If you configure your cluster to update your boot images, the boot image referenced in your machine sets matches the current version of the cluster.
54+
55+
.Prerequisites
56+
57+
* You have enabled the `TechPreviewNoUpgrade` feature set by using the feature gates. For more information, see "Enabling features using feature gates" in the "Additional resources" section.
58+
59+
.Procedure
60+
61+
. Edit the `MachineConfiguration` object, named `cluster`, to enable the updating of boot images by running the following command:
62+
+
63+
[source,terminal]
64+
----
65+
$ oc edit MachineConfiguration cluster
66+
----
67+
68+
.. Optional: Configure the boot image update feature for all the machine sets:
69+
+
70+
[source,yaml]
71+
----
72+
apiVersion: operator.openshift.io/v1
73+
kind: MachineConfiguration
74+
metadata:
75+
name: cluster
76+
namespace: openshift-machine-config-operator
77+
spec:
78+
# ...
79+
managedBootImages: <1>
80+
machineManagers:
81+
- resource: machinesets
82+
apiGroup: machine.openshift.io
83+
selection:
84+
mode: All <2>
85+
----
86+
<1> Activates the boot image update feature.
87+
<2> Specifies that all the machine sets in the cluster are to be updated.
88+
89+
.. Optional: Configure the boot image update feature for specific machine sets:
90+
+
91+
[source,yaml]
92+
----
93+
apiVersion: operator.openshift.io/v1
94+
kind: MachineConfiguration
95+
metadata:
96+
name: cluster
97+
namespace: openshift-machine-config-operator
98+
spec:
99+
# ...
100+
managedBootImages: <1>
101+
machineManagers:
102+
- resource: machinesets
103+
apiGroup: machine.openshift.io
104+
selection:
105+
mode: Partial
106+
partial:
107+
machineResourceSelector:
108+
matchLabels:
109+
update-boot-image: "true" <2>
110+
----
111+
<1> Activates the boot image update feature.
112+
<2> Specifies that any machine set with this label is to be updated.
113+
+
114+
[TIP]
115+
====
116+
If an appropriate label is not present on the machine set, add a key/value pair by running a command similar to following:
117+
118+
----
119+
$ oc label machineset.machine ci-ln-hmy310k-72292-5f87z-worker-a update-boot-image=true -n openshift-machine-api
120+
----
121+
====
122+
123+
.Verification
124+
125+
. Get the boot image version by running the following command:
126+
+
127+
[source,terminal]
128+
----
129+
$ oc get machinesets <machineset_name> -n openshift-machine-api -o yaml
130+
----
131+
+
132+
.Example machine set with the boot image reference
133+
+
134+
[source,yaml]
135+
----
136+
apiVersion: machine.openshift.io/v1beta1
137+
kind: MachineSet
138+
metadata:
139+
labels:
140+
machine.openshift.io/cluster-api-cluster: ci-ln-77hmkpt-72292-d4pxp
141+
update-boot-image: "true"
142+
name: ci-ln-77hmkpt-72292-d4pxp-worker-a
143+
namespace: openshift-machine-api
144+
spec:
145+
# ...
146+
template:
147+
# ...
148+
spec:
149+
# ...
150+
providerSpec:
151+
# ...
152+
value:
153+
disks:
154+
- autoDelete: true
155+
boot: true
156+
image: projects/rhcos-cloud/global/images/rhcos-416-92-202402201450-0-gcp-x86-64 <1>
157+
# ...
158+
----
159+
<1> This boot image is the same as the current {product-title} version.

nodes/nodes/nodes-nodes-managing.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ configuration of nodes. By creating an instance of a `KubeletConfig` object, a m
2121
// assemblies.
2222

2323
include::modules/nodes-nodes-managing-about.adoc[leveloffset=+1]
24+
include::modules/mco-update-boot-images.adoc[leveloffset=+1]
25+
26+
[role="_additional-resources"]
27+
.Additional resources
28+
29+
* xref:../../nodes/clusters/nodes-cluster-enabling-features.adoc#nodes-cluster-enabling[Enabling features using feature gates]
30+
31+
include::modules/mco-update-boot-images-disable.adoc[leveloffset=+2]
32+
2433
include::modules/nodes-nodes-working-master-schedulable.adoc[leveloffset=+1]
2534
include::modules/nodes-nodes-working-setting-booleans.adoc[leveloffset=+1]
2635
include::modules/nodes-nodes-kernel-arguments.adoc[leveloffset=+1]

post_installation_configuration/machine-configuration-tasks.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ include::modules/checking-mco-status.adoc[leveloffset=+2]
2929
include::modules/checking-mco-node-status.adoc[leveloffset=+2]
3030
include::modules/checking-mco-status-certs.adoc[leveloffset=+2]
3131

32+
include::modules/mco-update-boot-images.adoc[leveloffset=+1]
33+
34+
[role="_additional-resources"]
35+
.Additional resources
36+
37+
* xref:../nodes/clusters/nodes-cluster-enabling-features.adoc#nodes-cluster-enabling[Enabling features using feature gates]
38+
39+
include::modules/mco-update-boot-images-disable.adoc[leveloffset=+2]
40+
3241
[id="using-machineconfigs-to-change-machines"]
3342
== Using MachineConfig objects to configure nodes
3443

0 commit comments

Comments
 (0)