Fedora CoreOS (FCOS) image layering allows you to easily extend the functionality of your base FCOS image by layering additional images onto the base image. This layering does not modify the base FCOS image. Instead, it creates a custom layered image that includes all FCOS functionality and adds additional functionality to specific nodes in the cluster.
You create a custom layered image by using a Containerfile and applying it to nodes by using a MachineConfig
object. The Machine Config Operator overrides the base FCOS image, as specified by the osImageURL
value in the associated machine config, and boots the new image. You can remove the custom layered image by deleting the machine config, The MCO reboots the nodes back to the base FCOS image.
With FCOS image layering, you can install RPMs into your base image, and your custom content will be booted alongside FCOS. The Machine Config Operator (MCO) can roll out these custom layered images and monitor these custom containers in the same way it does for the default FCOS image. FCOS image layering gives you greater flexibility in how you manage your FCOS nodes.
|
Installing realtime kernel and extensions RPMs as custom layered content is not recommended. This is because these RPMs can conflict with RPMs installed by using a machine config. If there is a conflict, the MCO enters a degraded state when it tries to install the machine config RPM. You need to remove the conflicting extension from your machine config before proceeding.
|
As soon as you apply the custom layered image to your cluster, you effectively take ownership of your custom layered images and those nodes. While Red Hat remains responsible for maintaining and updating the base FCOS image on standard nodes, you are responsible for maintaining and updating images on nodes that use a custom layered image. You assume the responsibility for the package you applied with the custom layered image and any issues that might arise with the package.
|
Image layering is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
|
Currently, FCOS image layering allows you to work with Customer Experience and Engagement (CEE) to obtain and apply Hotfix packages on top of your FCOS image. In some instances, you might want a bug fix or enhancement before it is included in an official OKD release. FCOS image layering allows you to easily add the Hotfix before it is officially released and remove the Hotfix when the underlying FCOS image incorporates the fix.
|
Some Hotfixes require a Red Hat Support Exception and are outside of the normal scope of OKD support coverage or life cycle policies.
|
In the event you want a Hotfix, it will be provided to you based on Red Hat Hotfix policy. Apply it on top of the base image and test that new custom layered image in a non-production environment. When you are satisfied that the custom layered image is safe to use in production, you can roll it out on your own schedule to specific node pools. For any reason, you can easily roll back the custom layered image and return to using the default FCOS.
|
It is planned for future releases that you can use FCOS image layering to incorporate third-party software packages such as libreswan or numactl.
|
To apply a custom layered image, you create a Containerfile that references an OKD image and the Hotfix that you want to apply. For example:
Example Containerfile to apply a Hotfix
# Using a 4.12.0 image
FROM quay.io/openshift-release-dev/ocp-release@sha256...
#Install hotfix rpm
RUN rpm-ostree override replace https://example.com/myrepo/haproxy-1.0.16-5.el8.src.rpm && \
rpm-ostree cleanup -m && \
ostree container commit
|
Use the same base FCOS image installed on the rest of your cluster. Use the oc adm release info --image-for rhel-coreos-8 command to obtain the base image used in your cluster.
|
Push the resulting custom layered image to an image registry. In a non-production OKD cluster, create a MachineConfig
object for the targeted node pool that points to the new image.
The Machine Config Operator (MCO) updates the operating system with content provided in the machine config. This creates a custom layered image that overrides the base FCOS image on those nodes.
After you create the machine config, the MCO:
-
Renders a new machine config for the specified pool or pools.
-
Performs cordon and drain operations on the nodes in the pool or pools.
-
Writes the rest of the machine config parameters onto the nodes.
-
Applies the custom layered image to the node.
-
Reboots the node using the new image.
|
It is strongly recommended that you test your images outside of your production environment before rolling out to your cluster.
|