You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: machine_configuration/mco-coreos-layering.adoc
+5-9Lines changed: 5 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -30,11 +30,6 @@ As soon as you apply the custom layered image to your cluster, you effectively _
30
30
There are two methods for deploying a custom layered image onto your nodes:
31
31
32
32
On-cluster layering:: With xref:../machine_configuration/mco-coreos-layering.adoc#coreos-layering-configuring-on_mco-coreos-layering[on-cluster layering], you create a `MachineOSConfig` object where you include the Containerfile and other parameters. The build is performed on your cluster and the resulting custom layered image is automatically pushed to your repository and applied to the machine config pool that you specified in the `MachineOSConfig` object. The entire process is performed completely within your cluster.
33
-
+
34
-
--
35
-
:FeatureName: On-cluster image layering
36
-
include::snippets/technology-preview.adoc[]
37
-
--
38
33
39
34
Out-of-cluster layering:: With xref:../machine_configuration/mco-coreos-layering.adoc#coreos-layering-configuring_mco-coreos-layering[out-of-cluster layering], you create a Containerfile that references an {product-title} image and the RPM that you want to apply, build the layered image in your own environment, and push the image to your repository. Then, in your cluster, create a `MachineConfig` object for the targeted node pool that points to the new image. The Machine Config Operator overrides the base {op-system} image, as specified by the `osImageURL` value in the associated machine config, and boots the new image.
40
35
@@ -182,9 +177,11 @@ It is strongly recommended that you test your images outside of your production
* xref:../nodes/clusters/nodes-cluster-enabling-features.adoc#nodes-cluster-enabling[Enabling features using feature gates]
186
-
* xref:../updating/updating_a_cluster/update-using-custom-machine-config-pools.adoc#update-using-custom-machine-config-pools-pause_update-using-custom-machine-config-pools[Pausing the machine config pools]
187
180
* xref:../machine_configuration/mco-coreos-layering.adoc#coreos-layering-configuring-on-remove_mco-coreos-layering[Removing an on-cluster custom layered image]
181
+
* xref:../updating/updating_a_cluster/update-using-custom-machine-config-pools.adoc#update-using-custom-machine-config-pools-pause_update-using-custom-machine-config-pools[Pausing the machine config pools]
182
+
* xref:../machine_configuration/mco-coreos-layering.adoc#coreos-layering-configuring-on-rebuild_mco-coreos-layering[Rebuilding an on-cluster custom layered image]
183
+
* xref:../openshift_images/managing_images/using-image-pull-secrets.adoc#images-update-global-pull-secret_using-image-pull-secrets[Updating the global cluster pull secret]
184
+
* xref:../machine_configuration/mco-coreos-layering.adoc#coreos-layering-configuring-on-modifying_mco-coreos-layering[Modifying a custom layered image]
<1> Optional: Modify the Containerfile, for example to add or remove packages.
59
55
<2> Optional: Update the secret needed to pull the base operating system image from the registry.
60
56
<3> Optional: Modify the image registry to push the newly built custom layered image to.
61
57
<4> Optional: Update the secret needed to push the newly built custom layered image to the registry.
62
-
<5> Optional: Update the secret needed to pull the newly built custom layered image from the registry.
63
58
+
64
59
When you save the changes, the MCO drains, cordons, and reboots the nodes. After the reboot, the node uses the cluster base {op-system-first} image. If your changes modify a secret only, no new build is triggered and no reboot is performed.
65
60
@@ -75,9 +70,9 @@ $ oc get machineosbuild
75
70
.Example output
76
71
[source,terminal]
77
72
----
78
-
NAME PREPARED BUILDING SUCCEEDED INTERRUPTED FAILED
<1> The value `True` in the `BUILDING` column indicates that the `MachineOSBuild` object is building. When the `SUCCEEDED` column reports `True`, the build is complete.
In situations where you want to rebuild a custom layered image, you can either modify your `MachineOSConfig` object or add an annotation to the `MachineOSConfig` object. Both of these actions trigger an automatic rebuild of the object. For example, you could perform a rebuild if the you change the Containerfile or need to update the `osimageurl` location in a machine config.
10
+
11
+
After you add the annotation, the Machine Config Operator (MCO) deletes the current `MachineOSBuild` object and creates a new one in its place. When the build process is complete, the MCO automatically removes the annotation.
12
+
13
+
.Prerequisites
14
+
15
+
* You have opted-in to on-cluster layering by creating a `MachineOSConfig` object.
16
+
17
+
.Procedure
18
+
19
+
* Edit the `MachineOSConfig` object to add the `machineconfiguration.openshift.io/rebuild` annotation by using the following command:
<1> The value `True` in the `BUILDING` column indicates that the `MachineOSBuild` object is building.
58
+
59
+
* Edit the `MachineOSConfig` object to verify that the MCO removed the `machineconfiguration.openshift.io/rebuild` annotation by using the following command:
You can revert an on-cluster custom layered image from nodes by removing the label for the machine config pool (MCP) that you specified in the `MachineOSConfig` object. After you remove the label, the Machine Config Operator (MCO) reboots the nodes in that MCP with the cluster base {op-system-first} image, along with any previously-made machine config changes, overriding the custom layered image.
9
+
If you applied an on-cluster layered image to a node in a custom machine config pool (MCP), you can remove the custom layered image from the node and revert to the base image.
10
+
11
+
To revert the node, remove the node from the custom MCP by removing the custom machine config pool label from the node. After you remove the label, the Machine Config Operator (MCO) reboots the node with the cluster base {op-system-first} image, overriding the custom layered image.
10
12
11
13
[IMPORTANT]
12
14
====
13
-
If the node where the custom layered image is deployed uses a custom machine config pool, before you remove the label, make sure the node is associated with a second MCP.
15
+
Before you remove the label, make sure the node is associated with another MCP.
14
16
====
15
17
16
-
You can reapply the custom layered image to the node by using the `oc label node/<node_name> 'node-role.kubernetes.io/<mcp_name>='` label.
17
-
18
18
.Prerequisites
19
19
20
-
* You have opted in to on-cluster layering by creating a `MachineOSConfig` object.
20
+
* You have opted-in to on-cluster layering by creating a `MachineOSConfig` object.
21
+
* You have applied a `MachineOSConfig` object to a node in a custom machine config pool.
21
22
22
23
.Procedure
23
24
@@ -32,9 +33,9 @@ When you save the changes, the MCO drains, cordons, and reboots the nodes. After
32
33
33
34
.Verification
34
35
35
-
You can verify that the custom layered image is removed by performing the following checks:
36
+
* Verify that the custom layered image is removed by performing any of the following checks:
36
37
37
-
. Check that the worker machine config pool is updating with the previous machine config:
38
+
** Check that the worker machine config pool is updating with the previous machine config:
38
39
+
39
40
[source,terminal]
40
41
----
@@ -45,12 +46,14 @@ $ oc get mcp
45
46
[source,terminal]
46
47
----
47
48
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE
<1> The value `FALSE` in the `UPDATED` column indicates that the `MachineOSBuild` object is building. When the `UPDATED` column reports `FALSE`, the base image has rolled out to the nodes.
53
+
<1> The custom machine config pool no longer has any nodes.
54
+
<2> When the `UPDATING` field is `True`, the machine config pool is updating with the previous machine config. When the field becomes `False`, the worker machine config pool has rolled out to the previous machine config.
52
55
53
-
. Check the nodes to see that scheduling on the nodes is disabled. This indicates that the change is being applied:
56
+
** Check the nodes to see that scheduling on the nodes is disabled. This indicates that the change is being applied:
0 commit comments