|
| 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. |
0 commit comments