Skip to content

Commit bad8845

Browse files
author
Michael Burke
committed
quickstart edits
1 parent 9fa27f3 commit bad8845

File tree

2 files changed

+38
-53
lines changed

2 files changed

+38
-53
lines changed

modules/coreos-layering-configuring-on.adoc

Lines changed: 37 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,28 @@
66
[id="coreos-layering-configuring-on_{context}"]
77
= Using on-cluster layering to apply a custom layered image
88

9-
To apply a custom layered image to your cluster by using the on-cluster build process, make a `MachineOSConfig` custom resource that includes a Containerfile, a machine config pool reference, repository push and pull secrets, and other parameters as described in the prerequisites.
9+
To apply a custom layered image to your cluster by using the on-cluster build process, make a `MachineOSConfig` custom resource (CR) that specifies the following parameters:
1010

11-
When you create the object, the Machine Config Operator (MCO) creates a `MachineOSBuild` object and a `machine-os-builder` pod. The build process also creates transient objects, such as config maps, which are cleaned up after the build is complete.
11+
* the Containerfile to build
12+
* the machine config pool to associate the build
13+
* where the final image should be pushed and pulled from
14+
* the push and pull secrets to use
15+
16+
When you create the object, the Machine Config Operator (MCO) creates a `MachineOSBuild` object and a `machine-os-builder` pod. The build process also creates transient objects, such as config maps, which are cleaned up after the build is complete.
1217

1318
When the build is complete, the MCO pushes the new custom layered image to your repository for use when deploying new nodes. You can see the digested image pull spec for the new custom layered image in the `MachineOSBuild` object and `machine-os-builder` pod.
1419

1520
You should not need to interact with these new objects or the `machine-os-builder` pod. However, you can use all of these resources for troubleshooting, if necessary.
1621

1722
You need a separate `MachineOSConfig` CR for each machine config pool where you want to use a custom layered image.
1823

19-
:FeatureName: On-cluster image layering
20-
include::snippets/technology-preview.adoc[]
21-
2224
.Prerequisites
2325

24-
* You have enabled the `TechPreviewNoUpgrade` feature set by using the feature gates. For more information, see "Enabling features using feature gates".
26+
* You have a copy of the global pull secret in the `openshift-machine-config-operator` namespace that the MCO needs in order to pull the base operating system image.
2527
26-
* You have the pull secret in the `openshift-machine-config-operator` namespace that the MCO needs to pull the base operating system image.
28+
* You have a copy of the `etc-pki-entitlement` secret in the `openshift-machine-api` namespace.
2729
28-
* You have the push secret that the MCO needs to push the new custom layered image to your registry.
30+
* You have the push secret that the MCO needs in order to push the new custom layered image to your registry.
2931
3032
* You have a pull secret that your nodes need to pull the new custom layered image from your registry. This should be a different secret than the one used to push the image to the repository.
3133
@@ -50,30 +52,32 @@ spec:
5052
name: <mcp_name> <1>
5153
buildInputs:
5254
containerFile: # <2>
53-
- containerfileArch: noarch
55+
- containerfileArch: noarch <3>
5456
content: |-
55-
FROM configs AS final
57+
FROM configs AS final <4>
5658
RUN dnf install -y cowsay && \
5759
dnf clean all && \
5860
ostree container commit
59-
imageBuilder: # <3>
61+
imageBuilder: # <5>
6062
imageBuilderType: PodImageBuilder
61-
baseImagePullSecret: # <4>
63+
baseImagePullSecret: # <6>
6264
name: global-pull-secret-copy
63-
renderedImagePushspec: image-registry.openshift-image-registry.svc:5000/openshift/os-image:latest # <5>
64-
renderedImagePushSecret: # <6>
65+
renderedImagePushspec: image-registry.openshift-image-registry.svc:5000/openshift/os-image:latest # <7>
66+
renderedImagePushSecret: # <8>
6567
name: builder-dockercfg-7lzwl
66-
buildOutputs: # <7>
68+
buildOutputs: # <9>
6769
currentImagePullSecret:
6870
name: builder-dockercfg-7lzwl
6971
----
70-
<1> Specifies the name of the machine config pool associated with the nodes where you want to deploy the custom layered image.
71-
<2> Specifies the Containerfile to configure the custom layered image.
72-
<3> Specifies the name of the image builder to use. This must be `PodImageBuilder`.
73-
<4> Specifies the name of the pull secret that the MCO needs to pull the base operating system image from the registry.
74-
<5> Specifies the image registry to push the newly-built custom layered image to. This can be any registry that your cluster has access to. This example uses the internal {product-title} registry.
75-
<6> Specifies the name of the push secret that the MCO needs to push the newly-built custom layered image to that registry.
76-
<7> Specifies the secret required by the image registry that the nodes need to pull the newly-built custom layered image. This should be a different secret than the one used to push the image to your repository.
72+
<1> Specifies the machine config pool to deploy the custom layered image.
73+
<2> Specifies the Containerfile to configure the custom layered image. You can specify multiple build stages in the Containerfile.
74+
<3> Specifies the architecture of the image to be built. You must set this parameter to `noarch`.
75+
<4> Specifies the build stage as final. This field is required and applies to the last image in the build.
76+
<5> Specifies the name of the image builder to use. You must set this parameter to `PodImageBuilder`.
77+
<6> Specifies the name of the pull secret that the MCO needs in order to pull the base operating system image from the registry.
78+
<7> Specifies the image registry to push the newly-built custom layered image to. This can be any registry that your cluster has access to. This example uses the internal {product-title} registry.
79+
<8> Specifies the name of the push secret that the MCO needs in order to push the newly-built custom layered image to the registry.
80+
<9> Specifies the secret required by the image registry that the nodes need in order to pull the newly-built custom layered image. This should be a different secret than the one used to push the image to your repository.
7781

7882
.. Create the `MachineOSConfig` object:
7983
+
@@ -115,13 +119,14 @@ When you save the changes, the MCO drains, cordons, and reboots the nodes. After
115119

116120
.Verification
117121

118-
. Verify that the new pods are running by using the following command:
122+
. Verify that the new pods are ready by running the following command:
119123
+
120124
[source,terminal]
121125
----
122-
$ oc get pods -n <machineosbuilds_namespace>
126+
$ oc get pods -n openshift-machine-config-operator
123127
----
124128
+
129+
.Example output
125130
[source,terminal]
126131
----
127132
NAME READY STATUS RESTARTS AGE
@@ -132,48 +137,28 @@ machine-os-builder-6fb66cfb99-zcpvq 1/1 Runnin
132137
<1> This is the build pod where the custom layered image is building.
133138
<2> This pod can be used for troubleshooting.
134139

135-
. Verify that the `MachineOSConfig` object contains a reference to the new custom layered image:
140+
. Verify the current stage of your layered build by running the following command:
136141
+
137142
[source,terminal]
138143
----
139-
$ oc describe MachineOSConfig <object_name>
144+
$ oc get machineosbuilds
140145
----
141146
+
142-
[source,yaml]
147+
.Example output
148+
[source,terminal]
143149
----
144-
apiVersion: machineconfiguration.openshift.io/v1alpha1
145-
kind: MachineOSConfig
146-
metadata:
147-
name: layered
148-
spec:
149-
buildInputs:
150-
baseImagePullSecret:
151-
name: global-pull-secret-copy
152-
containerFile:
153-
- containerfileArch: noarch
154-
content: ""
155-
imageBuilder:
156-
imageBuilderType: PodImageBuilder
157-
renderedImagePushSecret:
158-
name: builder-dockercfg-ng82t-canonical
159-
renderedImagePushspec: image-registry.openshift-image-registry.svc:5000/openshift-machine-config-operator/os-image:latest
160-
buildOutputs:
161-
currentImagePullSecret:
162-
name: global-pull-secret-copy
163-
machineConfigPool:
164-
name: layered
165-
status:
166-
currentImagePullspec: image-registry.openshift-image-registry.svc:5000/openshift-machine-config-operator/os-image@sha256:f636fa5b504e92e6faa22ecd71a60b089dab72200f3d130c68dfec07148d11cd # <1>
150+
NAME PREPARED BUILDING SUCCEEDED INTERRUPTED FAILED
151+
layered-rendered-layered-ef6460613affe503b530047a11b28710-builder False True False False False
167152
----
168-
<1> Digested image pull spec for the new custom layered image.
169153

170-
. Verify that the `MachineOSBuild` object contains a reference to the new custom layered image.
154+
. Verify that the `MachineOSBuild` object contains a reference to the new custom layered image by running the following command:
171155
+
172156
[source,terminal]
173157
----
174158
$ oc describe machineosbuild <object_name>
175159
----
176160
+
161+
.Example output
177162
[source,yaml]
178163
----
179164
apiVersion: machineconfiguration.openshift.io/v1alpha1

modules/coreos-layering-configuring.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ metadata:
6565
spec:
6666
osImageURL: quay.io/my-registry/custom-image@sha256... <2>
6767
----
68-
<1> Specifies the machine config pool to apply the custom layered image.
68+
<1> Specifies the machine config pool to deploy the custom layered image.
6969
<2> Specifies the path to the custom layered image in the repository.
7070

7171
.. Create the `MachineConfig` object:

0 commit comments

Comments
 (0)