订阅内容

Since the launch of Red Hat Enterprise Linux (RHEL) 8.3 in November of 2020, we have been busy developing new features and adapting the operating system to handle the challenges associated with edge computing. With the launch of RHEL 9.2, we are introducing additional functionality, and this post will provide a deep dive into the new configuration options that we’re bringing to edge images. This post assumes some level of familiarity with using Image Builder, so if you need a good primer, this blog will get you up to speed. 

Image Builder blueprint customizations

RHEL 9.2 brings several enhancements to OS configuration. First, Image Builder has added support in the web console for editing blueprint configurations when installed on-prem. While some users will continue to prefer to edit the TOML configurations, this UI will be much simpler for users wanting to make quick edits using a browser.

Image Builder has added support in the web console for editing blueprint configurations

Also, users who are shipping appliances that need to be 100% pre-configured out-of-the-box will love the new ability to inject files and directories into /etc. Previously, editing configuration files in /etc was done using first boot automation or calling an automation tool like Ansible. While these continue to be viable options, it’s often better for embedded environments to be pre-configured on first boot. The example below can be added to a blueprint and will create a systemd drop-in to make the httpd.service restart automatically:

[[customizations.directories]]
path = "/etc/systemd/system/httpd.service.d"

[[customizations.files]]
path = "/etc/systemd/system/httpd.service.d/00-httpd-reboot.conf"
mode = "0644"
user = "root"
group = "root"
data = """[Service]
Restart=always"""

Support for Ignition

Users who prefer using a “golden image” approach and separating their deployment configuration from the image will love that Image Builder now supports Ignition configurations. Ignition has seen broad adoption within the Red Hat ecosystem with RHEL CoreOS in OpenShift and Fedora CoreOS, as well as a number of other distributions. When creating a simplified-installer-image with Image Builder we can pass a base64-encoded ignition configuration into the blueprint using: 

[customizations.ignition.embedded]
config =

Certain environments will benefit from having the entire Ignition config passed directly through the blueprint, and others will be better served using a stub config to query an HTTP endpoint for an updated configuration. Both are great options depending on the environment. Ignition also works well when provisioning RAW images. For these, we can pass the following to fetch the desired config:

[customizations.ignition.firstboot]
url = "http://$YOURSERVER/config.ign"

Introducing Quadlet

A related configuration topic that goes beyond the host operating system is how we define and configure containers. RHEL uses Podman as the container engine which, thanks to the integration with systemd, makes running and managing containers as easy as any other service running on the system. RHEL 9.2 includes Podman 4.4 which introduces Quadlet as a technology preview.

Quadlet tightens the integration of Podman and systemd and greatly improves the user experience. Podman has been able to directly generate systemd unit files for some time. One of the challenges with directly generating unit files is that over time they will need to be regenerated to align with newer releases of Podman. Quadlet is a systemd generator which abstracts this configuration.

Now it's much simpler and clearer to define details for how a container is run, and the configs become portable and future proof across fleets of systems. The full documentation is here and the example below will demonstrate how simple it is.

#configs are located here:
/etc/containers/systemd/nginx.container

#example configuration for nginx
[Service]
Restart=always

[Container]
ContainerName=nginx
Image=registry.access.redhat.com/ubi9/nginx-120:latest
Label="io.containers.autoupdate=image"
PublishPort=8080:8080
Exec=nginx -g "daemon off;"

[Install]
WantedBy=default.target

#notify systemd of the new container file
systemctl daemon-reload

#start the container
systemctl start nginx

The unit file that Quadlet generates can be viewed via # systemctl cat nginx. Another thing that’s especially helpful is the optional [Install] section from the example above will automatically enable the container to start on boot. Amazing right? To tie this all together, we can now inject Quadlet configs directly via Image Builder blueprints and/or by using Ignition configurations. 

RHEL 9.2 is a significant step forward in helping customers cut through the complexity found in edge environments. Here we've shown you how OS configuration of edge images is simpler and more flexible with Image Builder and Ignition.

For environments and use cases that benefit from maintaining configuration outside of the image, we highly recommend using Red Hat Ansible Automation Platform. The new infra.osbuild collection automates creating an Image Builder server and the creation of edge images and image updates over the life of edge deployments in the field. Be sure to check out this blog for more details.

Users can get started creating and using these images with a no-cost RHEL for Developer Subscription and the Hybrid Cloud Console. If you’d like to install Image Builder in your own environment please take a look at the official documentation or take a look at this demo repository for some examples. Stay tuned for more exciting edge announcements and blog posts coming soon.


关于作者

Ben Breard is a Senior Principal Product Manager at Red Hat, focusing on Red Hat Enterprise Linux and Edge Offerings.

Read full bio

Antonio started working for Red Hat in 2015. He joined while being the top-most Red Hat contributor to the Docker project, as well as being a maintainer too. He created the skopeo tool, as well as bootstrapping and integrating CRI-O into Red Hat OpenShift. He has led the OpenShift's Machine Config Operator team and he has since moved to lead the RHEL for Edge team. While not working, Antonio loves baking pizza and bread as well as preparing for Triathlons.

Read full bio
UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Original series icon

原创节目

关于企业技术领域的创客和领导者们有趣的故事