Customizing RHCOS with CoreOS Layering to Add the rsyslog Package
Introduction
Red Hat Enterprise Linux CoreOS (RHCOS) is the immutable, container-optimized operating system that powers OpenShift Container Platform nodes. While its immutability provides stability and security, there are scenarios where you might need to add additional packages or custom configurations. OpenShift’s CoreOS Layering feature allows you to extend the base RHCOS image by adding RPM packages, creating a customized OS layer.
This guide provides a step-by-step walkthrough of how to use CoreOS layering to build a custom RHCOS image that includes the rsyslog package. This is useful for environments that require traditional log forwarding mechanisms or need to integrate with existing logging infrastructure that relies on syslog. We will also install plymouth to ensure boot-time logs are captured correctly.
For more details, refer to the official OpenShift documentation on CoreOS layering.
Prerequisites
Before you begin, ensure you have the following:
-
A running OpenShift Container Platform 4.18 cluster.
-
Administrative access to the cluster with the
ocCLI tool. -
A Red Hat Enterprise Linux (RHEL) 9 host to build the custom image. The RHEL version must match the RHCOS version.
-
Podmaninstalled on the RHEL build host. -
A container registry (like Quay.io, Harbor, or Docker Hub) to store the custom image.
-
A pull secret from redhat cloud consle and store in
~/pull-secret.json.