订阅内容

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. ]

Key technologies

For this challenge, I relied primarily on three key technologies:

  • EC2 Graviton: The AWS Graviton chips are Arm-based 7nm processors designed by AWS and custom-built for cloud workloads. Graviton processors include dedicated cores and caches for each vCPU.
  • Image builder: RHEL's image builder creates installer media that embeds the OSTree commit. This is perfect for disconnected environments requiring an ISO, thumb drive, or some form of media that doesn't depend on network access. In this case, I used the RAW format to ensure compatibility with AWS.
  • MicroShift: This is OpenShift for the Edge and the software the image will run.

[ Free download: Advanced Linux commands cheat sheet. ]

Run an EC2 instance of your RHEL 9 AMI

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}]'

Install 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.

  1. Create a configuration directory structure:

    $ mkdir -p /etc/osbuild-composer/repositories
  2. Copy the utils/rhel-90.json to the config directory:

    $ sudo cp utils/rhel-90.json /etc/osbuild-composer/repositories
  3. 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

Build the image

You can now build your image, complete with MicroShift installed:

$ composer-cli blueprints push utils/microshift-blueprint-v0.0.1.toml

Orchestrate

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.


关于作者

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

原创节目

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