Image
![IT Automation ebook](/sysadmin/sites/default/files/styles/image_cta/public/2021-07/SysAdminGuidetoITAutomation-e-book-medium.jpg?itok=8_5VlQhF)
I was involved in a demo of Red Hat Enterprise Linux (RHEL) for Edge, using MicroShift and ImageBuilder, and I experienced some problems with the network driver for Raspberry Pi 4 in RHEL 8. To solve this problem, I decided to create a custom image based on RHEL 9 instead, and in my previous article, I explain how I did that. If you haven't read that article, please read it before continuing with this article.
(Note: This is not an officially supported configuration.
Also, At the time of this writing, there is no RHEL version for Raspberry Pi. RHEL for ARM is available only for larger 64-bit ARMv8 platforms. However, this is based on a demo, and if you need a supported Linux system, try Fedora on Raspberry Pi. Fedora 29 and later supports the Raspberry Pi Model 2B- and 3-series of devices, including the 3B, 3B+, 3A+, 3CM and 3CM+.)
In this article, I demonstrate how to generate your own RHEL 9 image with MicroShift.
MicroShift is an exploratory project created by Red Hat's edge computing team. Its goal is to tailor OpenShift for field-deployed devices, providing a consistent development and management experience across all footprints.
[ You might also be interested in reading How MicroShift and Kubernetes help manage edge devices at scale. ]
For this challenge, I relied primarily on three key technologies:
[ Free download: Advanced Linux commands cheat sheet. ]
First, you must run the RHEL 9 AMI you built in the first part of this series:
$ aws ec2 run-instances \
--image-id ami-[the-id-of-your-ami] \
--instance-type t4g.medium \
--subnet-id subnet-[the-id-of-your-subnet] \
--security-group-ids sg-[the-id-of-you-security-group] \
--associate-public-ip-address \
--key-name [the-name-of-your-ssh-key] \
--block-device-mappings "[{\"DeviceName\":\"/dev/xvda\",\"Ebs\":{\"VolumeSize\":60,\"DeleteOnTermination\":true}}]" \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=image-builder}]'
Next, install the image builder package and start it:
$ sudo dnf install -y osbuild-composer
$ sudo systemctl enable --now osbuild-composer.socket
You need to configure image builder with a repository override so that you can add custom repositories (or repositories that are different from the default repositories).
[ Learn how to modernize your IT with managed cloud services. ]
I've already created a configuration for this, so clone my Git repository to get the necessary JSON and TOML files.
Create a configuration directory structure:
$ mkdir -p /etc/osbuild-composer/repositories
Copy the utils/rhel-90.json
to the config directory:
$ sudo cp utils/rhel-90.json /etc/osbuild-composer/repositories
Add the new repositories (the TOML files in my Git repo) to the server:
$ composer-cli sources add utils/transmission.toml
$ composer-cli sources add utils/microshift.toml
Restart image builder so that it detects your changes:
$ sudo systemctl restart osbuild-composer.service
You can now build your image, complete with MicroShift installed:
$ composer-cli blueprints push utils/microshift-blueprint-v0.0.1.toml
This is all developing technology, so you may need to take some additional steps as it evolves, but the principles are the same as always. You're building reproducible images using configuration as code and running the images on the cloud.
There are many use cases for a RHEL image, and not just for edge computing. Build your own image and try it out for your next project.
Jose Antonio González Prada works for Red Hat as a Specialist Solution Architect, previously as a Senior Consultant, specializing in OpenShift and container-related technologies. More about me