Skip to content

Commit 8841db6

Browse files
authored
Merge pull request #89812 from mburke5678/mco-rhcos-layering-fixes
OCPBUGS:37531,42838,42013 RHCOS image layering fixes
2 parents 434e4b8 + cb6b1e8 commit 8841db6

File tree

2 files changed

+34
-25
lines changed

2 files changed

+34
-25
lines changed

machine_configuration/mco-coreos-layering.adoc

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,48 +60,49 @@ Hotfixes are provided to you based on link:https://access.redhat.com/solutions/2
6060
.Example on-cluster Containerfile to apply a Hotfix
6161
[source,yaml]
6262
----
63-
# Using a 4.17.0 image
6463
containerfileArch: noarch
6564
content: |-
6665
FROM configs AS final
67-
#Install hotfix rpm
68-
RUN dnf install -y https://example.com/myrepo/haproxy-1.0.16-5.el8.src.rpm && \
66+
#Install hotfix package
67+
RUN dnf update -y https://example.com/files/systemd-252-46.el9_4.x86_64.rpm \
68+
https://example.com/files/systemd-journal-remote-252-46.el9_4.x86_64.rpm \
69+
https://example.com/files/systemd-libs-252-46.el9_4.x86_64.rpm \
70+
https://example.com/files/systemd-pam-252-46.el9_4.x86_64.rpm \
71+
https://example.com/files/systemd-udev-252-46.el9_4.x86_64.rpm \
72+
https://example.com/files/systemd-rpm-macros-252-46.el9_4.noarch.rpm && \
6973
dnf clean all && \
7074
ostree container commit
7175
----
7276
+
7377
.Example out-of-cluster Containerfile to apply a Hotfix
7478
[source,yaml]
7579
----
76-
# Using a 4.17.0 image
7780
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
78-
#Install hotfix rpm
79-
RUN dnf install -y https://example.com/myrepo/haproxy-1.0.16-5.el8.src.rpm && \
81+
#Install hotfix package
82+
RUN dnf update -y https://example.com/files/systemd-252-46.el9_4.x86_64.rpm \
83+
https://example.com/files/systemd-journal-remote-252-46.el9_4.x86_64.rpm \
84+
https://example.com/files/systemd-libs-252-46.el9_4.x86_64.rpm \
85+
https://example.com/files/systemd-pam-252-46.el9_4.x86_64.rpm \
86+
https://example.com/files/systemd-udev-252-46.el9_4.x86_64.rpm \
87+
https://example.com/files/systemd-rpm-macros-252-46.el9_4.noarch.rpm && \
8088
dnf clean all && \
8189
ostree container commit
8290
----
91+
// https://issues.redhat.com/browse/OCPBUGS-42838
8392

8493
* *{op-system-base} packages*. You can download {op-system-base-full} packages from the link:https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.1/x86_64/packages[Red Hat Customer Portal], such as chrony, firewalld, and iputils.
8594
+
86-
.Example out-of-cluster Containerfile to apply the libreswan utility
95+
.Example out-of-cluster Containerfile to apply the rsyslog utility
8796
[source,yaml,subs="attributes+"]
8897
----
89-
# Get {op-system} base image of target cluster `oc adm release info --image-for rhel-coreos`
90-
# hadolint ignore=DL3006
98+
# Using a 4.18.0 image
9199
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
92-
93-
# Install our config file
94-
COPY my-host-to-host.conf /etc/ipsec.d/
95-
96-
# {op-system-base} entitled host is needed here to access {op-system-base} packages
97-
# Install libreswan as extra {op-system-base} package
98-
RUN dnf install -y libreswan && \
99-
dnf clean all && \
100-
systemctl enable ipsec && \
100+
# Install rsyslog package
101+
RUN dnf install -y rsyslog && \
101102
ostree container commit
103+
# Copy your custom configuration in
104+
ADD remote.conf /etc/rsyslog.d/remote.conf
102105
----
103-
+
104-
Because libreswan requires additional {op-system-base} packages, the image must be built on an entitled {op-system-base} host. For RHEL entitlements to work, you must copy the `etc-pki-entitlement` secret into the `openshift-machine-config-operator` namespace.
105106

106107
* *Third-party packages*. You can download and install RPMs from third-party organizations, such as the following types of packages:
107108
+
@@ -129,7 +130,6 @@ RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.n
129130
[source,yaml,subs="attributes+"]
130131
----
131132
# Get {op-system} base image of target cluster `oc adm release info --image-for rhel-coreos`
132-
# hadolint ignore=DL3006
133133
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
134134
135135
#Enable EPEL (more info at https://docs.fedoraproject.org/en-US/epel/ ) and install htop
@@ -139,7 +139,7 @@ RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.n
139139
ostree container commit
140140
----
141141
+
142-
This Containerfile installs the {op-system-base} fish program. Because fish requires additional {op-system-base} packages, the image must be built on an entitled {op-system-base} host. For {op-system-base} entitlements to work, you must copy the `etc-pki-entitlement` secret into the `openshift-machine-api` namespace.
142+
This Containerfile installs the {op-system-base} fish program. Because fish requires additional {op-system-base} packages, the image must be built on an entitled {op-system-base} host. For {op-system-base} entitlements to work, you must copy the `etc-pki-entitlement` secret into the `openshift-machine-config-operator` namespace.
143143
+
144144
.Example on-cluster Containerfile to apply a third-party package that has {op-system-base} dependencies
145145
[source,yaml]
@@ -157,7 +157,6 @@ RUN dnf install -y https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Pac
157157
[source,yaml,subs="attributes+"]
158158
----
159159
# Get {op-system} base image of target cluster `oc adm release info --image-for rhel-coreos`
160-
# hadolint ignore=DL3006
161160
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
162161
163162
# {op-system-base} entitled host is needed here to access {op-system-base} packages

modules/coreos-layering-configuring-on.adoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,17 @@ Note the following limitations when working with the on-cluster layering feature
8282

8383
* You have enabled the `TechPreviewNoUpgrade` feature set by using the feature gates. For more information, see "Enabling features using feature gates".
8484

85-
* You have a copy of the pull secret in the `openshift-machine-config-operator` namespace that the MCO needs to pull the base operating system image.
85+
* You have a copy of the pull secret in the `openshift-machine-config-operator` namespace that the MCO needs to pull the base operating system image.
86+
+
87+
For example, if you are using the global pull secret, you can run the following command:
88+
+
89+
[source,terminal]
90+
----
91+
$oc create secret docker-registry global-pull-secret-copy \
92+
--namespace "openshift-machine-config-operator" \
93+
--from-file=.dockerconfigjson=<(oc get secret/pull-secret -n openshift-config -o go-template='{{index .data ".dockerconfigjson" | base64decode}}')
94+
----
95+
// https://issues.redhat.com/browse/OCPBUGS-42013
8696

8797
// Not in 4.18; maybe in 4.19
8898
// If you are using the global pull secret, the MCO automatically creates a copy when you first create a `MachineOSconfig` object.
@@ -133,7 +143,7 @@ spec:
133143
name: builder-dockercfg-7lzwl
134144
buildOutputs: <9>
135145
currentImagePullSecret:
136-
name: builder-dockercfg-7lzwl
146+
name: builder-dockercfg-mtcl23
137147
----
138148
<1> Specifies the `machineconfiguration.openshift.io/v1` API that is required for `MachineConfig` CRs.
139149
<2> Specifies a name for the `MachineOSConfig` object. This name is used with other on-cluster layering resources. The examples in this documentation use the name `layered`.

0 commit comments

Comments
 (0)