Skip to content

Commit 1d7f628

Browse files
jlebondustymabe
authored andcommitted
README: talk more about MachineConfigs
This part is important because otherwise the node will immediately pivot back to the default image after bootup.
1 parent 6c1d60b commit 1d7f628

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ podman build \
5757
--tag quay.io/myorg/myrepo:mytag
5858
```
5959

60-
You will want to [push](https://docs.podman.io/en/latest/markdown/podman-push.1.html) this image to a registry so that it can be used as an `osImageUrl` in a MachineConfig as documented in the OpenShift docs.
61-
6260
# Creating disk boot images from the container image
6361

6462
First, we need to convert the image to an OCI archive:
@@ -93,3 +91,32 @@ sudo ./custom-coreos-disk-images.sh $ociarchive $platform
9391

9492
Which will create the file `my-custom-rhcos.ociarchive.x86_64.qcow2` in
9593
the current working directory that can then be used.
94+
95+
# Using the container image in the cluster
96+
97+
You will also want to [push](https://docs.podman.io/en/latest/markdown/podman-push.1.html)
98+
the custom container image to a registry and point OpenShift at it using a
99+
MachineConfig with the `osImageURL` field set to the image. Otherwise, upon
100+
booting, the node will immediately be switched to the default OS image for
101+
the target OpenShift version.
102+
103+
Create a MachineConfig like the following:
104+
105+
```yaml
106+
apiVersion: machineconfiguration.openshift.io/v1
107+
kind: MachineConfig
108+
metadata:
109+
labels:
110+
machineconfiguration.openshift.io/role: worker
111+
name: custom-image
112+
spec:
113+
osImageURL: example.com/my/custom-image@sha256...
114+
```
115+
116+
If scaling up, you can specify this MachineConfig as usual using `oc apply -f`.
117+
118+
If installing a cluster, you can specify the MachineConfig at that point so
119+
that it's part of the initial bootstrapping. For examples of this, see the
120+
documentation at:
121+
122+
https://docs.openshift.com/container-platform/4.17/installing/installing_bare_metal/installing-bare-metal.html#installation-user-infra-generate-k8s-manifest-ignition_installing-bare-metal

0 commit comments

Comments
 (0)