이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Operating system images for the Red Hat Edge Manager
Operating system images overview
Abstract
Chapter 1. Operating system images for the Red Hat Edge Manager 링크 복사링크가 클립보드에 복사되었습니다!
Image-based operating systems allow the operating system and the configuration and applications to be versioned, deployed, and updated as a single unit. Using an image-based operating system reduces operational risks with the following capability:
- Minimizing drift between tested and deployed environments.
- Reducing failed updates through transactional updates and rollbacks, and reducing maintenance and replacement costs.
The Red Hat Edge Manager focuses on image-based Linux operating systems that run bootable container image (bootc). For more information, see https://bootc-dev.github.io/bootc/.
Important: The bootc tool does not update package-based operating systems.
See the following description for the operating system images process:
-
Choose a base
bootcoperating system image, such as a Fedora, CentOS, or RHEL image. Create a container file that layers the following items onto the base
bootcimage:- The Red Hat Edge Manager agent and configuration.
- Optional: Any drivers specific to your target deployment environment.
- Optional: Host configuration, for example certificate authority bundles, and application workloads that are common to all deployments.
-
Build, publish, and sign a
bootcoperating system image usingpodmanandskopeo. -
Create an operating system disk image by using
bootc-image-builder. -
Build, publish, and sign an operating system disk image using
skopeo.
Note: The operating system disk image contains partitions, volumes, the file system, and the initial bootc image. The operating system disk image only needs to be created once, during provisioning.
For subsequent device updates, only the bootc operating system image is required, which contains the files in the file system.
See the following image building topics:
1.1. Special considerations for building images 링크 복사링크가 클립보드에 복사되었습니다!
- The following topics cover special considerations for building images for the Red Hat Edge Manager:
- Build-time configuration over dynamic runtime configuration
-
Configuration in
/usrdirectory - Drop-in directories
- Operating system images with scripts
1.1.1. Build-time configuration over dynamic runtime configuration 링크 복사링크가 클립보드에 복사되었습니다!
Add configuration to the operating system image at build time. Adding configuration at build time ensures that the configurations are tested, distributed, and updated together. In cases when build-time configuration is not feasible or desirable, you can dynamically configure devices at runtime instead with the Red Hat Edge Manager.
Dynamic runtime configuration is preferable in the following cases:
- You have a configuration that is deployment or site-specific, such as a hostname or a site-specific network credential.
- You have secrets that are not secure to distribute with the image.
- You have application workloads that need to be added, updated, or deleted without reboot or they are on a faster cadence than the operating system.
1.1.2. Configuration in /usr directory 링크 복사링크가 클립보드에 복사되었습니다!
Place configuration files in the /usr directory if the configuration is static and the application or service supports that configuration. By placing the configuration in the /usr directory, the configuration remains read-only and fully defined by the image.
It is not feasible or desirable to place the configuration in the /usr directory in the following cases:
- The configuration is deployment or site-specific.
-
The application or service only supports reading configuration from the
/etcdirectory. - The configuration might need to be changed at runtime.
1.1.3. Drop-in directories 링크 복사링크가 클립보드에 복사되었습니다!
Use drop-in directories to add, replace, or remove configuration files that the service aggregates. Do not directly edit your configuration files that might cause deviation from the target configuration.
Note: You can identify drop-in directories by the .d/ at the end of the directory name. For example, /etc/containers/certs.d, /etc/cron.d, and /etc/NetworkManager/conf.d.
1.1.4. Operating system images with scripts 링크 복사링크가 클립보드에 복사되었습니다!
Avoid executing scripts or commands that change the file system. The bootc or the Red Hat Edge Manager can overwrite the changed files that might cause a deviation or failed integrity checks.
Instead, run such scripts or commands during image building, so changes are part of the image. Alternatively, use the configuration management mechanisms of the Red Hat Edge Manager.
1.1.5. Additional resources 링크 복사링크가 클립보드에 복사되었습니다!
- See Generic guidance for building images.
- For more information about configuring devices at runtime, see Operating system configuration for edge devices.
1.2. Building a bootc operating system image for the Red Hat Edge Manager 링크 복사링크가 클립보드에 복사되었습니다!
-
To prepare your device to be managed by the Red Hat Edge Manager, build a
bootcoperating system image that contains the Red Hat Edge Manager agent. Then build an operating system disk image for your devices.
For more information, read the following sections: * Optional: Requesting an enrollment certificate for early binding * Optional: Using image pull secrets * Building the operating system image with bootc * Signing and publishing the bootc operating system image by using Sigstore * Building the operating system disk image * Signing and publishing the operating system disk image to an Open Container Initiative registry
1.2.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
See the following prerequisites for building a bootc operating system image:
-
Install
podmanversion 5.0 or later andskopeoversion 1.14 or later. See Getting container tools. -
Install
bootc-image-builder. See Installing bootc-image-builder.
1.2.2. Installing the Red Hat Edge Manager CLI 링크 복사링크가 클립보드에 복사되었습니다!
To install the Red Hat Edge Manager CLI, complete the following steps:
Enable the subscription manager for the repository appropriate for your system by running the following command:
sudo subscription-manager repos --enable edge-manager-1.0-for-rhel-9-x86_64-rpms
sudo subscription-manager repos --enable edge-manager-1.0-for-rhel-9-x86_64-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For a full list of available repositories for the Red Hat Edge Manager, see the Additional resources section.
Install the
flightctlCLI with your package manager by running the following command:sudo dnf install -y flightctl-cli
sudo dnf install -y flightctl-cliCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.3. Optional: Requesting an enrollment certificate for early binding 링크 복사링크가 클립보드에 복사되었습니다!
If you want to include an agent configuration in the image, complete the following steps:
Get the Red Hat Edge Manager API interface server. Run the following command:
export RHEM_API_SERVER_URL=$(oc get route -n open-cluster-management flightctl-api-route -o json | jq -r .spec.host)
export RHEM_API_SERVER_URL=$(oc get route -n open-cluster-management flightctl-api-route -o json | jq -r .spec.host)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Authenticate with the Red Hat Edge Manager service by using the
flightctlCLI. Run the following command:flightctl login --username=<your_user> --password=<your_password> https://$RHEM_API_SERVER_URL
flightctl login --username=<your_user> --password=<your_password> https://$RHEM_API_SERVER_URLCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note: The CLI uses the certificate authority pool of the host to verify the identity of the Red Hat Edge Manager service. The verification can lead to a TLS verification error when using self-signed certificates, if you do not add your certificate authority certificate to the pool. You can bypass the server verification by adding the
--insecure-skip-tls-verifyflag to your command.Obtain the enrollment credentials in the format of an agent configuration file by running the following command:
flightctl certificate request --signer=enrollment --expiration=365d --output=embedded > config.yaml
flightctl certificate request --signer=enrollment --expiration=365d --output=embedded > config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Notes:
-
The
--expiration=365doption specifies that the credentials are valid for a year. The
--output=embeddedoption specifies that the output is an agent configuration file with the enrollment credentials embedded.The returned
config.yamlcontains the URLs of the Red Hat Edge Manager service, the certificate authority bundle, and the enrollment client certificate and key for the agent. See the following example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The
1.2.4. Optional: Using image pull secrets 링크 복사링크가 클립보드에 복사되었습니다!
If your device relies on containers from a private repository, you must configure a pull secret for the registry. Complete the following steps:
Depending on the kind of container image you use, place the pull secret in one or both of the following system paths on the device:
-
Operating system images use the
/etc/ostree/auth.jsonpath. -
Application container images use the
/root/.config/containers/auth.jsonpath.
Important: The pull secret must exist on the device before the secret can be consumed.
-
Operating system images use the
Ensure that the pull secrets have the following format:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information, see the Additional resources section.
1.2.5. Building the operating system image with bootc 링크 복사링크가 클립보드에 복사되었습니다!
Build the operating system image with bootc that contains the Red Hat Edge Manager agent. You can optionally include the following items in your operating system image:
- The agent configuration for early binding
- Any drivers
- Host configuration
- Application workloads that you need
Note: You must build the operating system image on a Red Hat Enterprise Linux host that has the required entitlement for the specified rhem repository.
Complete the following steps:
Create a
Containerfilefile with the following content to build a Red Hat Enterprise Linux based operating system image that includes the Red Hat Edge Manager agent and configuration. Replacerhem-<2.x>andrhel-<version>with the version of the products that you are using:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Important: If your device relies on containers from a private repository, the device pull secret must be placed in the
/etc/ostree/auth.jsonpath. The pull secret must exist on the device before the secret can be consumed.Optional: To enable
podman-composeapplication support, add the following section to theContainerfilefile:RUN dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ dnf -y install podman-compose && \ dnf -y clean all && \ systemctl enable podman.serviceRUN dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ dnf -y install podman-compose && \ dnf -y clean all && \ systemctl enable podman.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If you created the
config.yamlfor early binding, add the following section to theContainerfile:ADD config.yaml /etc/flightctl/
ADD config.yaml /etc/flightctl/Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information, see Optional: Requesting an enrollment certificate for early binding.
Define the Open Container Initiative (OCI) registry by running the following command:
OCI_REGISTRY=registry.redhat.io
OCI_REGISTRY=registry.redhat.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Define the image repository that you have permissions to write to by running the following command:
OCI_IMAGE_REPO=${OCI_REGISTRY}/<your_org>/<your_image>OCI_IMAGE_REPO=${OCI_REGISTRY}/<your_org>/<your_image>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Define the image tag by running the following command:
OCI_IMAGE_TAG=v1
OCI_IMAGE_TAG=v1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Build the operating system image for your target platform:
sudo podman build -t ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG} .sudo podman build -t ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG} .Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.6. Signing and publishing the bootc operating system image by using Sigstore 링크 복사링크가 클립보드에 복사되었습니다!
To sign the bootc operating system image by using Sigstore, complete the following steps:
Generate a Sigstore key pair named
signingkey.pubandsigningkey.private:skopeo generate-sigstore-key --output-prefix signingkey
skopeo generate-sigstore-key --output-prefix signingkeyCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure container tools such as Podman and Skopeo to upload Sigstore signatures together with your signed image to your OCI registry:
sudo tee "/etc/containers/registries.d/${OCI_REGISTRY}.yaml" > /dev/null <<EOF docker: ${OCI_REGISTRY}: use-sigstore-attachments: true EOFsudo tee "/etc/containers/registries.d/${OCI_REGISTRY}.yaml" > /dev/null <<EOF docker: ${OCI_REGISTRY}: use-sigstore-attachments: true EOFCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to your OCI registry by running the following command:
sudo podman login ${OCI_REGISTRY}sudo podman login ${OCI_REGISTRY}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sign and publish the operating system image by running the following command:
sudo podman push \ --sign-by-sigstore-private-key ./signingkey.private \ ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG}sudo podman push \ --sign-by-sigstore-private-key ./signingkey.private \ ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.7. Building the operating system disk image 링크 복사링크가 클립보드에 복사되었습니다!
Build the operating system disk image that contains the file system for your devices. Complete the following steps:
Create a directory called
outputby running the following command:mkdir -p output
mkdir -p outputCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use
bootc-image-builderto generate an operating system disk image of typeisofrom your operating system image. Run the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
When the bootc-image-builder completes, you can find the ISO disk image at the ${PWD}/output/bootiso/install.iso path.
Sign and publish your disk image to your Open Container Initiative (OCI) registry. Optionally, you can compress and publish the disk image as an OCI artifact to the same OCI registry as your bootc images, which facilitates a unified hosting and distribution of bootc and disk images. To publish your ISO disk image to a repository named after your bootc image with /diskimage-iso appended, complete the following steps:
1.2.8.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- You created a private key by using Sigstore. See Signing and publishing the bootc operating system image by using Sigstore.
1.2.8.2. Optional: Signing and publishing the operating system disk image to an OCI registry 링크 복사링크가 클립보드에 복사되었습니다!
Sign and publish your disk image to your OCI registry. Complete the following steps:
Change the owner of the directory where the ISO disk image is located from
rootto your current user. Run the following command:sudo chown -R $(whoami):$(whoami) "${PWD}/output"sudo chown -R $(whoami):$(whoami) "${PWD}/output"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Define the
OCI_DISK_IMAGE_REPOenvironmental variable to be the same repository as yourbootcimage with/diskimage-isoappended. Run the following command:OCI_DISK_IMAGE_REPO=${OCI_IMAGE_REPO}/diskimage-isoOCI_DISK_IMAGE_REPO=${OCI_IMAGE_REPO}/diskimage-isoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a manifest list by running the following command:
sudo podman manifest create \ ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG}sudo podman manifest create \ ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the ISO disk image to the manifest list as an OCI artifact by running the following command:
sudo podman manifest add \ --artifact --artifact-type application/vnd.diskimage.iso \ --arch=amd64 --os=linux \ ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG} \ "${PWD}/output/bootiso/install.iso"sudo podman manifest add \ --artifact --artifact-type application/vnd.diskimage.iso \ --arch=amd64 --os=linux \ ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG} \ "${PWD}/output/bootiso/install.iso"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sign the manifest list with your private Sigstore key and push the image to the registry. Run the following command:
sudo podman manifest push --all \ --sign-by-sigstore-private-key ./signingkey.private \ ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG} \ docker://${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG}sudo podman manifest push --all \ --sign-by-sigstore-private-key ./signingkey.private \ ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG} \ docker://${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.9. Additional resources 링크 복사링크가 클립보드에 복사되었습니다!
- For a full list of available repositories for the Red Hat Edge Manager, see Download Red Hat Advanced Cluster Management for Kubernetes.
- For more information about building the operating system image on different target platforms, see Configuring container pull secrets.
1.3. Building for specific target platforms 링크 복사링크가 클립보드에 복사되었습니다!
For optimized provisioning and integration with Red Hat OpenShift Virtualization and VMware vSphere, enrollment certificates and agent configurations can be provided with cloud-init utility, rather than embedding them in the image. Additionally, you can include appropriate guest tools for better platform integration. This process generates platform-specific image formats, such as QCOW2 for Red Hat OpenShift Virtualization and VMDK for vSphere.
1.3.1. Building images for Red Hat OpenShift Virtualization 링크 복사링크가 클립보드에 복사되었습니다!
When building operating system images and disk images for Red Hat OpenShift Virtualization, you can follow the Building a bootc operating system image for the Red Hat Edge Manager process with the following changes:
-
Use late binding by injecting the enrollment certificate or the agent configuration through
cloud-initwhen provisioning the virtual device. -
Add the
open-vm-toolsguest tools to the image. -
Build a disk image of type
qcow2instead ofiso.
Note: You must build the operating system image on a Red Hat Enterprise Linux host that has the required entitlement for the specified rhacm repository.
Complete the generic steps with changes to the following steps:
- Build an operating system image that is based on RHEL 9 that includes the Red Hat Edge Manager agent and virtual machine guest tools, but excludes the agent configuration.
Create a file named
Containerfilewith the following content. Replacerhacm-<2.x>andrhel-<version>with the version of the products that you are using:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: To enable
podman-composeapplication support, add the following section to theContainerfilefile:RUN dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ dnf -y install podman-compose && \ dnf -y clean all && \ systemctl enable podman.serviceRUN dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ dnf -y install podman-compose && \ dnf -y clean all && \ systemctl enable podman.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Build, sign, and publish the bootc operating system image by following the generic image building process.
Create a directory called
outputby running the following command:mkdir -p output
mkdir -p outputCopy to Clipboard Copied! Toggle word wrap Toggle overflow Generate an operating system disk image of type
qcow2from your operating system image by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
When bootc-image-builder completes, you can find the disk image in the ${PWD}/output/vmdk/disk.vmdk path.
Red Hat OpenShift Virtualization can download disk images from an Open Container Initiative (OCI) registry, but it uses a container disk image instead of an OCI artifact.
Complete the following steps to build, sign, and upload the QCoW2 disk image:
Create a file that is named
Containerfile.qcow2with the following content:FROM registry.access.redhat.com/ubi9/ubi:latest AS builder ADD --chown=107:107 output/qcow2/disk.qcow2 /disk/ RUN chmod 0440 /disk/* FROM scratch COPY --from=builder /disk/* /disk/
FROM registry.access.redhat.com/ubi9/ubi:latest AS builder ADD --chown=107:107 output/qcow2/disk.qcow2 /disk/1 RUN chmod 0440 /disk/*2 FROM scratch COPY --from=builder /disk/* /disk/3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow Build, sign, and publish your disk image. Run the following command:
sudo chown -R $(whoami):$(whoami) "${PWD}/output" OCI_DISK_IMAGE_REPO=${OCI_IMAGE_REPO}/diskimage-qcow2 sudo podman build -t ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG} -f Containerfile.qcow2 . sudo podman push --sign-by-sigstore-private-key ./signingkey.private ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG}sudo chown -R $(whoami):$(whoami) "${PWD}/output" OCI_DISK_IMAGE_REPO=${OCI_IMAGE_REPO}/diskimage-qcow2 sudo podman build -t ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG} -f Containerfile.qcow2 . sudo podman push --sign-by-sigstore-private-key ./signingkey.private ${OCI_DISK_IMAGE_REPO}:${OCI_IMAGE_TAG}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3.2. Building images for VMware vSphere 링크 복사링크가 클립보드에 복사되었습니다!
When building operating system images and disk images for VMware vSphere, you can follow the Building a bootc operating system image for the Red Hat Edge Manager process with the following changes:
-
Using late binding by injecting the enrollment certificate or the agent configuration through
cloud-initwhen provisioning the virtual device. -
Adding the
open-vm-toolsguest tools to the image. -
Building a disk image of type
vmdkinstead ofiso.
Build an operating system image that is based on RHEL 9 that includes the Red Hat Edge Manager agent and VM guest tools, but excludes the agent configuration.
Note: You must build the operating system image on a Red Hat Enterprise Linux host that has the required entitlement for the specified rhacm repository.
Complete the generic steps with changes to the following steps:
Create a file that is named
Containerfilewith the following content. Replacerhacm-<2.x>andrhel-<version>with the version of the products that you are using:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a directory named
outputby running the following command:mkdir -p output
mkdir -p outputCopy to Clipboard Copied! Toggle word wrap Toggle overflow Generate an operating system disk image of type
vmdkfrom your operating system image by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
When bootc-image-builder completes, you can find the disk image in the ${PWD}/output/vmdk/disk.vmdk path.