Managing device fleets with the Red Hat Edge Manager
Install, configure, and use the Red Hat Edge Manager to manage individual and fleets of devices
Abstract
Preface Copy linkLink copied to clipboard!
The Red Hat Edge Manager aims to give simple, scalable, and secure management of edge devices and applications. You can declare the operating system version, host configuration, and set of applications that you want to run on an individual device or a whole fleet of devices. The Red Hat Edge Manager rolls out the target configuration to devices where a device agent automatically applies them and reports progress and health status back up.
The Red Hat Edge Manager 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.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Providing feedback on Red Hat documentation Copy linkLink copied to clipboard!
If you have a suggestion to improve this documentation, or find an error, you can contact technical support at https://access.redhat.com to open a request.
Chapter 1. Red Hat Edge Manager overview Copy linkLink copied to clipboard!
The Red Hat Edge Manager provides streamlined management of edge devices and applications through a declarative approach. By defining the required state of your edge devices, which includes your operating system versions, host configurations, and application deployments, the Red Hat Edge Manager automatically implements and maintains these configurations across your entire device fleet.
The Red Hat Edge Manager on Ansible Automation Platform offers elevated integration with your automations. You can then focus more on orchestrating the environment without worrying about updating the operating system.
See the following topics to learn more about using Red Hat Edge Manager on Ansible Automation Platform:
Chapter 2. Red Hat Edge Manager architecture Copy linkLink copied to clipboard!
You can manage individual devices or an entire fleet by using the Red Hat Edge Manager. The Red Hat Edge Manager uses an agent-based architecture that allows for a scalable and robust device management, even with limited network conditions.
By deploying a Red Hat Edge Manager agent to a device, the agent autonomously manages and monitors the device while periodically communicating with the Red Hat Edge Manager service to check for new configurations and to report device status.
The Red Hat Edge Manager supports image-based operating systems. You can include the Red Hat Edge Manager agent and the agent configuration in the image that is distributed to the devices.
Image-based operating systems allow the agent to start a transactional update of the image and to roll back to the earlier version in case of an update error.
The Red Hat Edge Manager architecture has the following main features:
- Agent
- Service
- Image-based operating system
- API server
- Database
- Device
- Device fleet
Learn more from the following sections:
2.1. Red Hat Edge Manager agent and service Copy linkLink copied to clipboard!
The Red Hat Edge Manager agent is a process running on each managed device that periodically communicates with the Red Hat Edge Manager service. The agent is responsible for the following tasks:
- Enrolling devices into the service
- Periodically checking with the service for changes in the device specification, such as changes to the operating system, configuration, and applications
- Applying any updates independently from the service
- Reporting status of the device and the applications
The Red Hat Edge Manager service is responsible for the following tasks:
- Authenticating and authorizing users and agents
- Enrolling devices
- Managing device inventory
- Reporting status from individual devices or fleets
The service also communicates with a database that stores the device inventory and the target device configuration. When communicating with the service, the agent polls the service for changes in the configuration. If the agent detects that the current configuration deviates from the target configuration, the agent attempts to apply the changes to the device.
When the agent receives a new target configuration from the service, the agent does the following tasks:
- To avoid depending on network connectivity during the update, the agent downloads all required resources, such as the operating system image and application container images, over the network to disk.
-
The agent updates the operating system image by delegating to
bootc. - The agent updates configuration files on the file system of the device by overlaying a set of files that the service sends to the device.
- If necessary, the agent reboots into the new operating system. Otherwise, the agent signals system services and applications to reload the updated configuration.
- The agent updates applications running on Podman.
If the update fails or the system does not return online after rebooting, the agent automatically rolls back to the earlier operating system image and configuration.
You can keep fleet definitions in Git. The Red Hat Edge Manager periodically syncs with the fleet definitions in the database.
2.2. Red Hat Edge Manager API server Copy linkLink copied to clipboard!
The API server is a core part of the Red Hat Edge Manager service that gives users and agents an option to communicate with the service.
The API server exposes the following endpoints:
- User-facing API endpoint
- Users can connect to the user-facing API endpoint from the CLI or the web console. Users must authenticate on the platform gateway to obtain a JSON Web Token (JWT) to make HTTPS requests.
- Agent-facing API endpoint
- Agents connect to the agent-facing endpoint, which is mTLS-protected. The service authenticates devices by using the X.509 client certificates.
The Red Hat Edge Manager service also communicates with various external systems to authenticate and authorize users, get mTLS certificates signed, or query configuration for managed devices.
2.3. Device enrollment Copy linkLink copied to clipboard!
You must enroll devices to a Red Hat Edge Manager service before you can start managing them. The Red Hat Edge Manager agent that runs on a device handles the device enrollment.
When the agent starts on a device, the agent searches for the configuration in the /etc/flightctl/config.yaml file. The file defines the following configurations:
- The enrollment endpoint, which is the Red Hat Edge Manager service that the agent connects to for enrollment.
- The enrollment certificate, which is the X.509 client certificate and key that the agent only uses to securely request enrollment from the Red Hat Edge Manager service.
- Optional: Any additional agent configuration.
The agent starts the enrollment process by searching for the enrollment endpoint, the Red Hat Edge Manager service, that is defined in the configuration file. After establishing a secure, mTLS-protected network connection with the service, the agent submits an enrollment request to the service.
The request includes a description of hardware and operating system of the device, a X.509 certificate signing request, and the cryptographic identity of the device. The enrollment request must be approved by an authorized user. After the request is approved, the device becomes trusted and managed by the Red Hat Edge Manager service.
2.3.1. Enrollment methods Copy linkLink copied to clipboard!
You can provision the enrollment endpoint and certificate to the device in the following ways:
- Early binding
- You can build an operating system image that includes the enrollment endpoint and certificate. Devices using an early binding image can automatically connect to the defined service to request enrollment, without depending on any provisioning infrastructure. The devices share the same long-lived X.509 client certificate. However, in this case, the devices are bound to a specific service and owner.
- Late binding
- You can define the enrollment endpoint and certificate at provisioning time instead of including them in the operating system image. Devices using a late binding image are not bound to a single owner or service and can have device-specific, short-lived X.509 client certificates. However, late binding requires virtualization or bare-metal provisioning infrastructure that can request device-specific enrollment endpoints and certificates from the Red Hat Edge Manager service and inject them into the provisioned system by using mechanisms such as cloud-init, Ignition, or kickstart.
The enrollment certificate is only used to secure the network connection for submitting an enrollment request. The enrollment certificate is not involved in the actual verification or approval of the enrollment request. The enrollment certificate is no longer used with enrolled devices, as the devices rely on device-specific management certificates instead.
Chapter 3. Installing the Red Hat Edge Manager on Ansible Automation Platform Copy linkLink copied to clipboard!
Install the Red Hat Edge Manager to manage edge devices and applications at scale. This guide focuses on a standalone deployment of the Red Hat Edge Manager on Red Hat Enterprise Linux alongside Ansible Automation Platform.
3.1. Installing the Red Hat Edge Manager RPM package Copy linkLink copied to clipboard!
Prepare your Red Hat Enterprise Linux host for the installation of the Red Hat Edge Manager by enabling the necessary repositories, installing the flightctl-services package, configuring the baseDomain, and then starting and verifying the running services.
Prerequisites
- An active Ansible Automation Platform subscription with a running instance and the necessary API URLs and OAuth credentials.
- A separate machine from Ansible Automation Platform to install the Red Hat Edge Manager on.
- Podman installed for managing containers.
A Red Hat Enterprise Linux host with:
- Minimal installation
- 4 cores and 16GB RAM (recommended)
- Administrative access (root or sudo-capable user)
- SSH access
Procedure
- SSH into your Red Hat Enterprise Linux host.
Authenticate and log in to the Red Hat Container Registry:
sudo podman login registry.redhat.io
sudo podman login registry.redhat.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the necessary repositories and packages:
Ensure that the Ansible Automation Platform repositories are enabled by running the following example command based on the version of Red Hat Enterprise Linux and architecture of your host:
sudo subscription-manager repos --enable ansible-automation-platform-2.5-for-rhel-9-x86_64-rpms
sudo subscription-manager repos --enable ansible-automation-platform-2.5-for-rhel-9-x86_64-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the Red Hat Edge Manager service by running:
sudo dnf install -y flightctl-services
sudo dnf install -y flightctl-servicesCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Update the installed
/etc/flightctl/service-config.yamlto set thebaseDomain:sudo vi /etc/flightctl/service-config.yaml
sudo vi /etc/flightctl/service-config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEnsure that you set the
baseDomainin the service configuration correctly. By default, the installation process attempts to automatically set this value based on the IP address of your Red Hat Enterprise Linux host.However, if your environment uses a specific domain name to access this host, for example
rhem-example.com, it is recommended that you manually update thebaseDomainin/etc/flightctl/service-config.yamlto this hostname.Setting the
baseDomaincorrectly ensures that all generated URLs, certificates, and internal configurations within the Red Hat Edge Manager are accurate for your network setup. This is especially important for integration with Ansible Automation Platform and for ensuring that the UI is accessible through the intended domain name.You can check the currently configured
baseDomainusing:grep baseDomain: /etc/flightctl/service-config.yaml
grep baseDomain: /etc/flightctl/service-config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the services:
sudo systemctl enable flightctl.target sudo systemctl start flightctl.target
sudo systemctl enable flightctl.target sudo systemctl start flightctl.targetCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that services are running:
sudo systemctl list-units flightctl-*.service
sudo systemctl list-units flightctl-*.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow You should see these 7 services running:
- flightctl-db
- flightctl-kv
- flightctl-api
- flightctl-periodic
- flightctl-worker
- flightctl-ui
- flightctl-cli-artifacts
Go to the UI at the
baseDomainstored in the service configuration file:grep baseDomain: /etc/flightctl/service-config.yaml
grep baseDomain: /etc/flightctl/service-config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Visit the displayed
baseDomainin your web browser to access the UI.
Troubleshooting
If your services do not run correctly, use the following log command to troubleshoot further and remediate:
journalctl -u flightctl-<impacted service> -b --no-pager
journalctl -u flightctl-<impacted service> -b --no-pager
3.2. Set up the OAuth application for Ansible Automation Platform Copy linkLink copied to clipboard!
You have two options for setting up the OAuth application in Ansible Automation Platform, either manually or automatically in the Ansible Automation Platform UI.
3.2.1. Setting up the OAuth application automatically Copy linkLink copied to clipboard!
Automatic setup of an OAuth application by generating an OAuth token within Ansible Automation Platform and adding it to your configuration file. Upon service startup, the application is automatically created, and the client ID updated.
Procedure
Generate an OAuth token in Ansible Automation Platform:
- From the navigation panel, select → .
- Select a user with write permissions to the Default organization (admin user recommended).
- Click the Tokens tab for that user.
Click and enter the relevant details.
- Scope: Select Write.
-
Go to the Integrating with Ansible Automation Platform section for the steps to edit your
service-config.yamlfile and complete setting up the OAuth application automatically.
3.2.2. Setting up the OAuth application manually Copy linkLink copied to clipboard!
Manually set up an OAuth application within your Ansible Automation Platform instance. This is important for enabling token-based authentication and integrating external applications such as the Red Hat Edge Manager.
Procedure
- From the navigation panel on your Ansible Automation Platform instance, go to → .
- Click .
Enter the following details:
- Name: Enter a name such as "Red Hat Edge Manager". This is the name visible in the Ansible Automation Platform UI.
-
URL: The
baseDomainof your Red Hat Edge Manager UI withhttps://. - Organization: Select Default.
- Authorization grant type: Select Authorization code.
- Client: Select Public.
Redirect URIs:
-
The redirect configured for your UI is your
baseDomainwith a /callback route appended, such ashttps://your-edge-manager-ip-or-domain:443/callback. If you have more than one URI, enter them in this field separated by a space, not commas or other delimiters. -
To provide a redirect for CLI usage (
flightctl login), configure a redirect URI, such ashttp://127.0.0.1/callback.
-
The redirect configured for your UI is your
- Click . An Application Links section is now visible in the navigation panel.
-
Copy the Client ID as you need it to update the oAuthApplicationClientId in your
service-config.yamlfile with this value. -
Go to the Integrating with Ansible Automation Platform section for the steps to edit your
service-config.yamlfile and complete setting up the OAuth application manually.
Additional resources
3.2.3. Integrating with Ansible Automation Platform Copy linkLink copied to clipboard!
Integrate the Red Hat Edge Manager with your Ansible Automation Platform instance by modifying the service-config.yaml file to include authentication type, API URLs, OAuth client ID, and an optional OAuth token, followed by restarting the services.
Procedure
Stop the flightctl services before editing your
service-config.yamlfile:sudo systemctl stop flightctl.target
sudo systemctl stop flightctl.targetCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the integration settings by editing the configuration file:
sudo vi /etc/flightctl/service-config.yaml
sudo vi /etc/flightctl/service-config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the configuration file to integrate with Ansible Automation Platform:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The domain name or IP for the host, this is automatically set when the RPM is installed but you can override this. It is the only field that is mandatory.
- 2
- Set this to
aapto enable Ansible Automation Platform authentication. - 3
- Set to
false. Only set this totrueto skip TLS certificate verification for the Ansible Automation Platform URLs. For production environments, consider configuring a CA certificate (see the Self-signed certificates section). - 4
- The internal facing API URL for the running Ansible Automation Platform instance that makes requests against. You can configure this URL to be an internally accessible URL for the running Ansible Automation Platform instance. For example, if there are separate internal or external ingresses.
- 5
- The externally accessible URL of your running Ansible Automation Platform instance.
- 6
- If you are using the automatic method, this field is not necessary. This is the Client ID of the OAuth application configured in Ansible Automation Platform for the Red Hat Edge Manager. If you do not have one yet, you can leave this empty and give an
oAuthTokento allow the setup to create it. - 7
- If you are using the manual method, this field is not necessary. This is an OAuth token with write permissions for the "Default" organization in your Ansible Automation Platform instance. This is only needed if you want the setup process to automatically create the OAuth application. Once created, this token is no longer necessary.
Start the services:
sudo systemctl start flightctl.target
sudo systemctl start flightctl.targetCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3. Self-signed certificates Copy linkLink copied to clipboard!
The Red Hat Edge Manager services automatically generate and store self-signed certificates in the /etc/flightctl/pki directory. These include:
-
/etc/flightctl/pki/ca.crt -
/etc/flightctl/pki/ca.key -
/etc/flightctl/pki/client-enrollment.crt -
/etc/flightctl/pki/client-enrollment.key -
/etc/flightctl/pki/server.crt -
/etc/flightctl/pki/server.key
You can use your own custom certificates by placing them in the following locations:
Custom Server Certificate/Key Pair:
-
/etc/flightctl/pki/server.crt -
/etc/flightctl/pki/server.key
-
Custom CA Certificate for Ansible Automation Platform authentication:
-
/etc/flightctl/pki/auth/ca.crt
-
Ensure that you adjust the insecureSkipTlsVerify setting in the service-config.yaml if you use a custom CA certificate for your Ansible Automation Platform instance.
Chapter 4. Operating system images for using with the Red Hat Edge Manager Copy linkLink copied to clipboard!
Image-based operating systems allow the operating system and its configuration and applications to be versioned, deployed, and updated as a single unit. Using an image-based operating system reduces operational risks by doing the following:
- Minimizing potential drift between what is tested and what is deployed to a large number of devices.
- Minimizing the risk of failed updates that require expensive maintenance or replacement through transactional updates and rollbacks.
The Red Hat Edge Manager focuses on image-based Linux operating systems that run bootable container images (bootc).
For more information, see bootc.
The bootc tool does not update package-based operating systems.
4.1. The image building process Copy linkLink copied to clipboard!
-
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.
The operating system disk image has partitions, volumes, the file system, and the initial bootc image. You only need to create the operating system disk image once, during provisioning. For later device updates, you only need the bootc operating system image, which has the files in the file system.
4.2. Special considerations for building images Copy linkLink copied to clipboard!
4.2.1. Build-time configuration over dynamic runtime configuration Copy linkLink copied to clipboard!
Add the configuration to the operating system image at build time. Adding the 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.
4.2.2. Configuration in the /usr directory Copy linkLink copied to clipboard!
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.
Do not 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.
4.2.3. Drop-in directories Copy linkLink copied to clipboard!
Use drop-in directories to add, replace, or remove configuration files that the service aggregates. Do not directly edit your configuration files because it can cause deviations from the target configuration.
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.
4.2.4. Operating system images with scripts Copy linkLink copied to clipboard!
Avoid executing scripts or commands that change the file system. The bootc or the Red Hat Edge Manager can overwrite the changed files which can cause a deviation or failed integrity checks..
Instead, run such scripts or commands during image building so changes are part of the image. You can also use the configuration management mechanisms of the Red Hat Edge Manager.
Additional resources
4.3. Building a bootc operating system image for the Red Hat Edge Manager Copy linkLink copied to clipboard!
To prepare your device to be managed by the Red Hat Edge Manager, build a bootc operating system image that has the Red Hat Edge Manager agent. Then build an operating system disk image for your devices.
For more information, see the following sections:
- Installing the Red Hat Edge Manager CLI
- 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
- Optional: Signing and publishing the operating system disk image to an Open Container Initiative registry
4.3.1. Prerequisites Copy linkLink copied to clipboard!
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.
4.3.2. Installing the Red Hat Edge Manager CLI Copy linkLink copied to clipboard!
To install the Red Hat Edge Manager CLI, complete the following steps:
Procedure
Enable the subscription manager for the repository appropriate for your system by running the following command:
sudo subscription-manager repos --enable ansible-automation-platform-2.5-for-rhel-9-x86_64-rpms
sudo subscription-manager repos --enable ansible-automation-platform-2.5-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 flightctl
sudo dnf install flightctlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If you set up the OAuth application manually, you also need to make sure that one utility xdg-open, x-www-browser, or www-browser is available, for example, by installing xdg-utils.
4.3.3. Logging into the Red Hat Edge Manager through the CLI Copy linkLink copied to clipboard!
How you log in the Red Hat Edge Manager depends on whether you choose the automatic or manual method when you initially set up the application.
Procedure
If you use the automatic setup you can create a personal access token, even only with Read scope (under the profile icon in the top right corner of your Ansible Automation Platform UI > User details > Tokens tab) and then use this token to log in directly through the CLI, with the following example syntax:
flightctl login https://<your-edge-manager-ip-or-domain>:3443 --token=<your-aap-oauth-token> --insecure-skip-tls-verify
flightctl login https://<your-edge-manager-ip-or-domain>:3443 --token=<your-aap-oauth-token> --insecure-skip-tls-verifyCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you use the manual setup, use the Client ID to log in through a web-based process, with the following example syntax:
flightctl login https://<your-edge-manager-ip-or-domain>:3443 --web --client-id=<your-aap-client-id> --insecure-skip-tls-verify
flightctl login https://<your-edge-manager-ip-or-domain>:3443 --web --client-id=<your-aap-client-id> --insecure-skip-tls-verifyCopy to Clipboard Copied! Toggle word wrap Toggle overflow This opens in a web browser and asks you to approve.
The
--insecure-skip-tls-verifyparameter is used only if you have not generated your own valid certificates.
Next steps
Use the following commands to help you with the CLI:
To output a list of available commands, use:
flightctl
flightctlCopy to Clipboard Copied! Toggle word wrap Toggle overflow To output both the flightctl CLI version and the back-end Red Hat Edge Manager version, use:
flightctl version
flightctl versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To ensure supportability and proper functionality, the version of the flightctl CLI must match the version of the Red Hat Edge Manager in use. Mismatched versions are not supported.
4.3.4. Optional: Requesting an enrollment certificate for early binding Copy linkLink copied to clipboard!
If you want to include an agent configuration in the image, complete the following steps:
Procedure
Log in to the flightctl CLI by following the steps in Logging into the Red Hat Edge Manager through the CLI.
NoteThe 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.Get 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 Note-
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
4.3.5. Optional: Using image pull secrets Copy linkLink copied to clipboard!
If your device relies on containers from a private repository, you must configure a pull secret for the registry. Complete the following steps:
Procedure
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.ImportantThe pull secret must exist on the device before the secret can be consumed.
-
Operating system images use the
Ensure that the pull secrets use the following format:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information, see the Additional resources section.
4.3.6. Building the operating system image with bootc Copy linkLink copied to clipboard!
Build the operating system image with the 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
Complete the following steps:
Procedure
Create a
Containerfilefile with the following content to build a RHEL 9-based operating system image that includes the Red Hat Edge Manager agent and configuration:FROM registry.redhat.io/rhel9/rhel-bootc:<required_os_version> RUN dnf --enablerepo ansible-automation-platform-2.5-for-rhel-9-x86_64-rpms -y install flightctl-agent-0.7.2-1.el9fc && \ dnf -y clean all && \ systemctl enable flightctl-agent.service && \ systemctl mask bootc-fetch-apply-updates.timerFROM registry.redhat.io/rhel9/rhel-bootc:<required_os_version>1 RUN dnf --enablerepo ansible-automation-platform-2.5-for-rhel-9-x86_64-rpms -y install flightctl-agent-0.7.2-1.el9fc && \ dnf -y clean all && \ systemctl enable flightctl-agent.service && \ systemctl mask bootc-fetch-apply-updates.timer2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantIf your device relies on containers from a private repository, you must place the device pull secret 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 -y 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 -y 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
4.3.7. Signing and publishing the bootc operating system image by using Sigstore Copy linkLink copied to clipboard!
To sign the bootc operating system image by using Sigstore, complete the following steps:
Procedure
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
4.3.8. Building the operating system disk image Copy linkLink copied to clipboard!
Build the operating system disk image that contains the file system for your devices.
Complete the following steps:
Procedure
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 by running 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.
4.3.9. Optional: Signing and publishing the operating system disk image to an Open Container Initiative registry Copy linkLink copied to clipboard!
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.
Prerequisites
- You created a private key by using Sigstore. See Signing and publishing the bootc operating system image by using Sigstore.
Sign and publish your disk image to your OCI registry by completing the following steps:
Procedure
Change the owner of the directory where the ISO disk image is located from
rootto your current user by running 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 by running 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 by running 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
4.3.10. Additional resources Copy linkLink copied to clipboard!
- For more information about building the operating system image on different target platforms, see Configuring container pull secrets.
4.3.11. Requirements for specific target platforms Copy linkLink copied to clipboard!
See the following platform considerations:
4.3.11.1. Building images for Red Hat OpenShift Virtualization Copy linkLink copied to clipboard!
When building operating system images and disk images for Red Hat OpenShift Virtualization, you can follow the generic image building 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
qcow2instead ofiso.
Complete the generic steps with changes to the following steps:
Procedure
- Build an operating system image based on RHEL 9 that includes the Red Hat Edge Manager agent and VM guest tools but excludes the agent configuration.
Create a file named
Containerfilewith the following content: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
4.3.11.2. Building the bootc image Copy linkLink copied to clipboard!
Build, sign, and publish the bootc operating system image by following the generic image building process:
Procedure
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
vmdkfrom your operating system image by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
When the bootc-image-builder completes, you can find the disk image under ${PWD}/output/vmdk/disk.vmdk.
4.3.11.3. Building the QCoW2 disk image Copy linkLink copied to clipboard!
Red Hat OpenShift Virtualization can download disk images from an OCI registry but it expects a container disk image instead of an OCI artifact.
Complete the following steps to build, sign, and upload the QCoW2 disk image:
Procedure
Create a file called
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 by running 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
4.3.11.4. Building images for VMware vSphere Copy linkLink copied to clipboard!
When building operating system images and disk images for VMware vSphere, you can follow the generic image building 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.
Complete the generic steps with changes to the following steps:
Procedure
- Build an operating system image based on RHEL 9 that includes the Red Hat Edge Manager agent and VM guest tools but excludes the agent configuration.
Create a file named
Containerfilewith the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
vmdkfrom your operating system image by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
When the bootc-image-builder completes, you can find the disk image under ${PWD}/output/vmdk/disk.vmdk.
Chapter 5. Provision devices Copy linkLink copied to clipboard!
You can provision devices with the Red Hat Edge Manager in different environments. Use the operating system image or disk image that you built for use with the Red Hat Edge Manager. Depending on your target environment, provision a physical or virtual device.
See the following sections:
5.1. Provision physical devices Copy linkLink copied to clipboard!
When you build an International Organization for Standardization (ISO) disk image from an operating system image by using the bootc-image-builder tool, the image is similar to the RHEL ISOs available for download. However, your operating system image content is embedded in the ISO disk image.
To install the ISO disk image to a bare metal system without having access to the network, see Deploying a custom ISO container image in the Red Hat Enterprise Linux documentation.
To install the ISO disk image through the network, see Deploying an ISO bootc image over PXE boot in the Red Hat Enterprise Linux documentation.
5.2. Provision devices with OpenShift Virtualization Copy linkLink copied to clipboard!
You can provision a virtual machine on OpenShift Virtualization by using a QCoW2 container disk image that is hosted on an OCI container registry.
If your operating system image does not already contain the Red Hat Edge Manager agent enrollment configuration, you can inject the configuration through the cloud-init user data at provisioning.
5.2.1. Creating the cloud-init configuration Copy linkLink copied to clipboard!
The cloud-init configuration customizes a virtual machine instance on its first boot, allowing you to automatically enroll it as a new agent in your Red Hat Edge Manager service.
Prerequisites
-
You installed the
flightctlCLI and logged in to your Red Hat Edge Manager service instance. -
You installed the
ocCLI, used it to log in to your OpenShift cluster instance, and changed to the project in which you want to create your virtual machine.
Procedure
Request a new Red Hat Edge Manager agent enrollment configuration and store it in a file called
config.yamlby 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 Create a cloud configuration user data file called
cloud-config.yamlthat places the agent configuration in the correct location on the first boot by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Kubernetes
Secretthat contains the cloud configuration user data file:oc create secret generic enrollment-secret --from-file=userdata=cloud-config.yaml
oc create secret generic enrollment-secret --from-file=userdata=cloud-config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2.2. Creating the virtual machine Copy linkLink copied to clipboard!
Create a virtual machine that has its primary disk populated from your QCoW2 container disk image and a cloud-init configuration drive that is populated from your enrollment secret.
Complete the following steps:
Procedure
Create a file that has the
VirtualMachineresource manifest by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the resource manifest to your cluster by running the following command:
oc apply -f my-bootc-vm.yaml
oc apply -f my-bootc-vm.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
Chapter 6. Manage devices Copy linkLink copied to clipboard!
The Red Hat Edge Manager manages the device lifecycle from enrollment to decommissioning of a device. The device lifecycle also includes device management, such as organizing, monitoring, and updating your devices with the Red Hat Edge Manager.
You can manage your devices individually or in a fleet. With the Red Hat Edge Manager you can manage a whole fleet of devices as a single object instead of managing many devices individually.
You only need to specify the required configuration once, and then the Red Hat Edge Manager applies the configuration to all devices in the fleet.
Understanding individual device management is the foundation for managing devices in a fleet. You might want to manage your devices individually in the following scenarios:
- If a few devices have different configurations.
- If you use external automation for updating the device.
The following sections focus on managing individual devices:
6.1. Enroll devices Copy linkLink copied to clipboard!
To manage your devices with the Red Hat Edge Manager, you must enroll the devices to the Red Hat Edge Manager service.
The first time the Red Hat Edge Manager agent runs on a device, the agent prepares for the enrollment process by generating a cryptographic key pair. The cryptographic key pair serves as the unique cryptographic identity of the device. The key pair consists of a public and a private key. The private key never leaves the device, so that the device cannot be duplicated or impersonated.
When the device is not yet enrolled, the agent performs service discovery to find its Red Hat Edge Manager service instance. Then, the device establishes a secure, mTLS-protected network connection to the service. The device uses its X.509 enrollment certificate that the device acquired during image building or device provisioning. The device submits an enrollment request to the service that includes the following:
- a description of the device hardware and operating system
- an X.509 Certificate Signing Request which includes the cryptographic identity of the device to obtain the initial management certificate
The device is not considered trusted and remains quarantined in a device lobby until an authorized user approves or denies the request.
For more information, see the following sections:
6.1.1. Enrolling devices on the CLI Copy linkLink copied to clipboard!
You must enroll devices into the Red Hat Edge Manager service before you can manage them.
Prerequisites
- You must install the Red Hat Edge Manager CLI. See Installing the Red Hat Edge Manager CLI.
- You must log in to the Red Hat Edge Manager service.
Procedure
List all devices that are currently waiting for approval by running the following command:
flightctl get enrollmentrequests --field-selector="status.approval.approved != true"
flightctl get enrollmentrequests --field-selector="status.approval.approved != true"Copy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example:
NAME APPROVAL APPROVER APPROVED LABELS <device_name> Pending <none> <none>
NAME APPROVAL APPROVER APPROVED LABELS <device_name> Pending <none> <none>Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe unique device name is generated by the agent and you cannot change it. The agent chooses a base32-encoded hash of its public key as the device name.
Approve an enrollment request by specifying the name of the enrollment request. Optionally, you can add labels to the device by using the
--labelor-lflags. See the following example:flightctl approve -l region=eu-west-1 -l site=factory-berlin enrollmentrequest/54shovu028bvj6stkovjcvovjgo0r48618khdd5huhdjfn6raskg
flightctl approve -l region=eu-west-1 -l site=factory-berlin enrollmentrequest/54shovu028bvj6stkovjcvovjgo0r48618khdd5huhdjfn6raskgCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output:
NAME APPROVAL APPROVER APPROVED LABELS <device_name> Approved user region=eu-west-1,site=factory-berlin
NAME APPROVAL APPROVER APPROVED LABELS <device_name> Approved user region=eu-west-1,site=factory-berlinCopy to Clipboard Copied! Toggle word wrap Toggle overflow
After you approve the enrollment request, the service issues the management certificate for the device and registers the device in the device inventory. You can then manage the device.
6.2. View devices Copy linkLink copied to clipboard!
To get more information about the devices in your inventory, you can use the Red Hat Edge Manager CLI.
6.2.1. Viewing device inventory and device details on the web UI Copy linkLink copied to clipboard!
You can view details for enrolled devices, including their status and health, on the Red Hat Edge Manager web UI
Prerequisites
- You must install the Red Hat Edge Manager CLI. See Installing the Red Hat Edge Manager CLI.
- You must enroll at least one device.
Procedure
- From the navigation panel, select → . This opens the external Edge Manager instance.
- From the navigation panel, select Devices where you can view your device inventory, details, and decommission devices.
6.2.2. Viewing device inventory and device details on the CLI Copy linkLink copied to clipboard!
Complete the following steps:
Procedure
View the devices in the device inventory by running the following command:
flightctl get devices
flightctl get devicesCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output:
NAME ALIAS OWNER SYSTEM UPDATED APPLICATIONS LAST SEEN <device_name> <none> <none> Online Up-to-date <none> 3 seconds ago
NAME ALIAS OWNER SYSTEM UPDATED APPLICATIONS LAST SEEN <device_name> <none> <none> Online Up-to-date <none> 3 seconds agoCopy to Clipboard Copied! Toggle word wrap Toggle overflow View the details of this device in YAML format by running the following command:
flightctl get device/<device_name> -o yaml
flightctl get device/<device_name> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- User-defined labels assigned to the device.
- 2
- The target OS image version of the device.
- 3
- The target OS configuration of the device.
- 4
- The current OS image version of the device
- 5
- The current OS configuration version of the device.
- 6
- The current list of deployed applications of the device.
- 7
- The health status of applications on the device.
- 8
- The availability of CPU, disk, and memory resources.
- 9
- Basic system information.
- 10
- The health status of the device.
- 11
- The update status of the device.
- 12
- The last check-in time and date of the device.
6.2.3. Labels and label selectors Copy linkLink copied to clipboard!
You can organize your resources by assigning them labels, for example, to record their location, hardware type, or purpose. The Red Hat Edge Manager labels follow the same syntax, principles, and operators as Kubernetes labels and label selectors. You can select devices with labels when viewing the device inventory or applying operations to the devices.
Labels follow the key=value format. You can use the key to group devices. For example, if your labels follow the site=<location> naming convention, you can group your devices by site. You can also use labels that only consist of keys.
Labels must adhere to the following rules to be valid:
- Keys and value must each be 63 characters or less.
-
Keys and values can consist of alphanumeric characters (
a-z,A-Z,0-9). -
Keys and values can also contain dashes (
-), underscores (_), dots (.) but not as the first or last character. - Value can be omitted.
You can apply labels to devices in the following ways:
- Define a set of default labels during image building that are automatically applied to all devices during deployment.
- Assign initial labels during enrollment.
- Assign labels post-enrollment.
When resources are labeled, you can select a subset of devices by creating a label selector. A label selector is a comma-separated list of labels for selecting devices that have the same set of labels.
See the following examples:
| Example label selector | Selected devices |
|---|---|
|
|
All devices with a |
|
|
All devices with a |
|
|
All devices with a |
For more information about labels and selectors, see Labels and Selectors in the Kubernetes documentation.
6.2.3.1. Viewing devices and their labels on the web UI Copy linkLink copied to clipboard!
View devices and their associated labels on the web UI. You can use labels to organize your devices and device fleets.
Complete the following steps:
- From the navigation panel, select → . This opens the external Edge Manager instance.
- From the navigation panel, select Devices.
- Select the device you want to manage. In the Details tab you can view the associated labels under Labels.
6.2.3.2. Viewing devices and their labels on the CLI Copy linkLink copied to clipboard!
View devices and their associated labels. You can use labels to organize your devices and device fleets.
Complete the following steps:
Procedure
View devices in your inventory with their labels by using the
-o wideoption:flightctl get devices -o wide
flightctl get devices -o wideCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output:
NAME ALIAS OWNER SYSTEM UPDATED APPLICATIONS LAST SEEN LABELS <device1_name> <none> <none> Online Up-to-date <none> 3 seconds ago region=eu-west-1,site=factory-berlin <device2_name> <none> <none> Online Up-to-date <none> 1 minute ago region=eu-west-1,site=factory-madrid
NAME ALIAS OWNER SYSTEM UPDATED APPLICATIONS LAST SEEN LABELS <device1_name> <none> <none> Online Up-to-date <none> 3 seconds ago region=eu-west-1,site=factory-berlin <device2_name> <none> <none> Online Up-to-date <none> 1 minute ago region=eu-west-1,site=factory-madridCopy to Clipboard Copied! Toggle word wrap Toggle overflow View devices in your inventory with a specific label or set of labels by using the
-l <key=value>option:flightctl get devices -l site=factory-berlin -o wide
flightctl get devices -l site=factory-berlin -o wideCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output:
NAME ALIAS OWNER SYSTEM UPDATED APPLICATIONS LAST SEEN LABELS <device1_name> <none> <none> Online Up-to-date <none> 3 seconds ago region=eu-west-1,site=factory-berlin
NAME ALIAS OWNER SYSTEM UPDATED APPLICATIONS LAST SEEN LABELS <device1_name> <none> <none> Online Up-to-date <none> 3 seconds ago region=eu-west-1,site=factory-berlinCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2.3.3. Updating labels on the CLI Copy linkLink copied to clipboard!
Update labels on your devices by using the CLI.
Complete the following steps:
Procedure
Export the current definition of the device into a file by running the following command:
flightctl get device/<device1_name> -o yaml > my_device.yaml
flightctl get device/<device1_name> -o yaml > my_device.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use your preferred editor to edit the
my_device.yamlfile. See the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the file and apply the updated device definition by running the following command:
flightctl apply -f my_device.yaml
flightctl apply -f my_device.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify your changes by running the following example output:
NAME ALIAS OWNER SYSTEM UPDATED APPLICATIONS LAST SEEN LABELS <device1_name> <none> <none> Online Up-to-date <none> 3 minutes ago some_key=some_value,some_other_key=some_other_value <device2_name> <none> <none> Online Up-to-date <none> 4 minutes ago region=eu-west-1,site=factory-madrid
NAME ALIAS OWNER SYSTEM UPDATED APPLICATIONS LAST SEEN LABELS <device1_name> <none> <none> Online Up-to-date <none> 3 minutes ago some_key=some_value,some_other_key=some_other_value <device2_name> <none> <none> Online Up-to-date <none> 4 minutes ago region=eu-west-1,site=factory-madridCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2.4. Field selectors Copy linkLink copied to clipboard!
Field selectors filter a list of Red Hat Edge Manager resources based on specific resource field values. They follow the same syntax, principles, and operators as Kubernetes Field and Label selectors, with additional operators available for more advanced search use cases.
6.2.4.1. Supported fields Copy linkLink copied to clipboard!
Red Hat Edge Manager resources give a set of metadata fields that you can select.
Each resource supports the following metadata fields:
-
metadata.name -
metadata.owner -
metadata.creationTimestamp
To query labels, use Label Selectors for advanced and flexible label filtering.
For more information, see Labels and label selectors.
6.2.4.2. List of additional supported fields Copy linkLink copied to clipboard!
In addition to the metadata fields, each resource has its own unique set of fields that you can select, offering further flexibility in filtering and selection based on resource-specific attributes.
The following table lists the fields supported for filtering for each resource kind:
| Kind | Fields |
|---|---|
| Certificate Signing Request |
|
| Device |
|
| Enrollment Request |
|
| Fleet |
|
| Repository |
|
| Resource Sync |
|
6.2.4.3. Fields discovery Copy linkLink copied to clipboard!
Some Red Hat Edge Manager resources might expose additional supported fields. You can discover the supported fields by using flightctl with the --field-selector option. If you try to use an unsupported field, the error message lists the available supported fields.
See the following examples:
flightctl get device --field-selector='text'
flightctl get device --field-selector='text'
Error: listing devices: 400, message: unknown or unsupported selector: unable to resolve selector name "text". Supported selectors are: [metadata.alias metadata.creationTimestamp metadata.name metadata.nameoralias metadata.owner status.applicationsSummary.status status.lastSeen status.summary.status status.updated.status]
Error: listing devices: 400, message: unknown or unsupported selector: unable to resolve selector name "text". Supported selectors are: [metadata.alias metadata.creationTimestamp metadata.name metadata.nameoralias metadata.owner status.applicationsSummary.status status.lastSeen status.summary.status status.updated.status]
The field text is not a valid field for filtering. The error message provides a list of supported fields that you can use with --field-selector for the Device resource.
You can then use one of the supported fields:
flightctl get devices --field-selector 'metadata.alias contains cluster'
flightctl get devices --field-selector 'metadata.alias contains cluster'
The metadata.alias field is checked with the containment operator contains to see if it has the value cluster.
Examples
Example 1: Excluding a specific device by name
The following command filters out a specific device by its name:
flightctl get devices --field-selector 'metadata.name!=c3tkb18x9fw32fzx5l556n0p0dracwbl4uiojxu19g2'
flightctl get devices --field-selector 'metadata.name!=c3tkb18x9fw32fzx5l556n0p0dracwbl4uiojxu19g2'
Example 2: Filter by owner, labels, and creation timestamp
This command retrieves devices owned by Fleet/pos-fleet, located in the us region, and created in 2024:
flightctl get devices --field-selector 'metadata.owner=Fleet/pos-fleet, metadata.creationTimestamp >= 2024-01-01T00:00:00Z, metadata.creationTimestamp < //2025-01-01T00:00:00Z' -l 'region=us'
flightctl get devices --field-selector 'metadata.owner=Fleet/pos-fleet, metadata.creationTimestamp >= 2024-01-01T00:00:00Z, metadata.creationTimestamp < //2025-01-01T00:00:00Z' -l 'region=us'
Example 3: Filter by Owner, Labels, and Device Status
This command retrieves devices owned by Fleet/pos-fleet, located in the us region, and with a status.updated.status of either Unknown or OutOfDate:
flightctl get devices --field-selector 'metadata.owner=Fleet/pos-fleet, status.updated.status in (Unknown, OutOfDate)' -l 'region=us'
flightctl get devices --field-selector 'metadata.owner=Fleet/pos-fleet, status.updated.status in (Unknown, OutOfDate)' -l 'region=us'
6.2.4.4. Supported operators Copy linkLink copied to clipboard!
| Operator | Symbol | Description |
|---|---|---|
| Exists |
| Checks if a field exists |
| DoesNotExist |
| Checks if a field does not exist |
| Equals |
| Checks if a field is equal to a value |
| DoubleEquals |
| Another form of equality check |
| NotEquals |
| Checks if a field is not equal to a value |
| GreaterThan |
| Checks if a field is greater than a value |
| GreaterThanOrEquals |
| Checks if a field is greater than or equal to a value |
| LessThan |
| Checks if a field is less than a value |
| LessThanOrEquals |
| Checks if a field is less than or equal to a value |
| In |
| Checks if a field is within a list of values |
| NotIn |
| Checks if a field is not in a list of values |
| Contains |
| Checks if a field has a value |
| NotContains |
| Checks if a field does not contain a value |
6.2.4.4.1. Operators usage by field type Copy linkLink copied to clipboard!
Each field type supports a specific subset of operators:
| Field Type | Supported Operators | Value |
|---|---|---|
| String |
| Text string |
| Timestamp |
| RFC 3339 format |
| Number |
| Number format |
| Boolean |
Note
The list can only contain
|
Boolean format ( |
| Array |
Note
Using | Array element |
6.3. Update the operating system Copy linkLink copied to clipboard!
You can update the operating system of a device by updating the target operating system image name or version in the device specification. When the agent communicates with the server, the agent detects the requested update. Then, the agent automatically starts downloading and verifying the new operating system version in the background. The Red Hat Edge Manager agent schedules the actual system update that is performed according to the update policy. At the scheduled update time, the agent installs the new version without disrupting the currently running operating system. Finally, the device reboots into the new version.
The Red Hat Edge Manager currently supports the following image type and image reference format:
| Image Type | Image Reference |
|---|---|
| bootc |
An OCI image reference to a container registry. Example: |
During the process, the agent sends status updates to the service. You can check the update process by viewing the device status.
For more information, see View devices.
6.3.1. Updating the operating system on the CLI Copy linkLink copied to clipboard!
Update a device using the CLI.
Complete the following steps:
Procedure
Get the current resource manifest of the device by running the following command:
flightctl get device/<device_name> -o yaml > my_device.yaml
flightctl get device/<device_name> -o yaml > my_device.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
Deviceresource to specify the new operating system name and version target.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the updated
Deviceresource by running the following command:flightctl apply -f <device_name>.yaml
flightctl apply -f <device_name>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.4. Operating system configuration for edge devices Copy linkLink copied to clipboard!
You can include an operating system-level host configuration in the image to give maximum consistency and repeatability. To update the configuration, create a new operating system image and update devices with the new image.
However, updating devices with a new image can be impractical in the following cases:
- The configuration is missing in the image.
- The configuration needs to be specific to a device.
- The configuration needs to be updateable at runtime without updating the operating system image and rebooting.
For these cases, you can declare a set of configuration files that are present on the file system of the device. The Red Hat Edge Manager agent applies updates to the configuration files while ensuring that either all files are successfully updated in the file system, or rolled back to their pre-update state. If the user updates both an operating system and configuration set of a device at the same time, the Red Hat Edge Manager agent updates the operating system first. It then applies the specified set of configuration files.
You can also specify a list of configuration sets that the Red Hat Edge Manager agent applies in sequence. In case of a conflict, the last applied configuration set is valid.
After the Red Hat Edge Manager agent updates the configuration on the disk, the running applications need to reload the new configuration into memory for the configuration to become effective. If the update involves a reboot, systemd automatically restarts the applications with the new configuration and in the correct order. If the update does not involve a reboot, many applications can detect changes to their configuration files and automatically reload the files. When an application does not support change detection, you can use device lifecycle hooks to run scripts or commands if certain conditions are met.
6.4.1. Configuration providers Copy linkLink copied to clipboard!
You can provide configuration from many sources, called configuration providers, in Red Hat Edge Manager. The Red Hat Edge Manager currently supports the following configuration providers:
- Git Config Provider
- Fetches device configuration files from a Git repository.
- Kubernetes Secret Provider
- Fetches a secret from a Kubernetes cluster and writes the content to the file system of the device.
- HTTP Config Provider
- Fetches device configuration files from an HTTP(S) endpoint.
- Inline Config Provider
- Allows specifying device configuration files inline in the device manifest without querying external systems.
Read more about the configuration providers in the following sections:
6.4.1.1. Configuration from a Git repository Copy linkLink copied to clipboard!
You can store device configuration in a Git repository such as GitHub or GitLab. You can then add a Git Config Provider so that the Red Hat Edge Manager synchronizes the configuration from the repository to the file system of the device.
The Git Config Provider takes the following parameters:
| Parameter | Description |
|
|
The name of a |
|
| The branch, tag, or commit of the repository to checkout. |
|
|
The absolute path to the directory in the repository from which files and subdirectories are synchronized to the file system of the device. The |
|
|
Optional. The absolute path to the directory in the file system of the device to write the content of the repository to. By default, the value is the file system root ( |
The Repository resource defines the Git repository, the protocol, and the access credentials that the Red Hat Edge Manager must use. You only need to set up the repository once. After setting up, you can use the repository to configure individual devices or device fleets.
6.4.1.2. Secrets from a Kubernetes cluster Copy linkLink copied to clipboard!
The Red Hat Edge Manager can query only the Kubernetes cluster that the Red Hat Edge Manager is running on for a Kubernetes secret. You can write the content of that secret to a path on the device file system.
The Kubernetes Secret Provider takes the following parameters:
| Parameter | Description |
|
| The name of the secret. |
|
| The namespace of the secret. |
|
| The directory in the file system of the device to write the secret contents to. |
The Red Hat Edge Manager needs permission to access secrets in the defined namespace. For example, creating a ClusterRole and ClusterRoleBinding allows the flightctl-worker service account to get and list secrets in that namespace.
6.4.1.3. Configuration from an HTTP server Copy linkLink copied to clipboard!
The Red Hat Edge Manager can query an HTTP server for configuration. The HTTP server can serve static or dynamically generated configuration for a device.
The HTTP Config Provider takes the following parameters:
| Parameter | Description |
|
|
The name of a |
|
|
The suffix to append to the base URL defined in the |
|
| The absolute path to the file in the file system of the device to write the response of the HTTP server to. |
The Repository resource specifies the HTTP server for the Red Hat Edge Manager to connect to, and the protocol and access credentials to use. You must set up the repository needs once, and then you can use the repository to configure many devices or device fleets.
6.4.1.4. Configuration inline in the device specification Copy linkLink copied to clipboard!
You can specify configuration inline in a device specification. When you use the inline device specification, the Red Hat Edge Manager does not need to connect to external systems to fetch the configuration.
The Inline Config Provider takes a list of file specifications, where each file specification takes the following parameters:
| Parameter | Description |
|
| The absolute path to the file in the file system of the device to write the content to. If a file already exists in the specified path, the file is overwritten. |
|
| The UTF-8 or base64-encoded content of the file. |
|
|
Defines how the contents are encoded. Must be either |
|
|
Optional. The permission mode of the file. You can specify the octal with a leading zero, for example |
|
|
Optional. The owner of the file. Specified either as a name or numeric ID. Default value is set to |
|
| Optional. The group of the file. Specified either as a name or numeric ID. |
Additional resources
6.4.2. Managing the device configuration from a Git repository on the CLI Copy linkLink copied to clipboard!
Create and apply a device configuration in a Git repository.
Complete the following steps:
Procedure
Create a file, for example
site-settings-repo.yaml, that contains the following definition for aRepositoryresource, namedsite-settings:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
Repositoryresource by running the following command:flightctl apply -f site-settings-repo.yaml
flightctl apply -f site-settings-repo.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the resource has been correctly created and is accessible by Red Hat Edge Manager running the following command:
flightctl get repository/site-settings
flightctl get repository/site-settingsCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output:
NAME TYPE REPOSITORY URL ACCESSIBLE site-settings git https://github.com/<your_org>/<your_repo>.git True
NAME TYPE REPOSITORY URL ACCESSIBLE site-settings git https://github.com/<your_org>/<your_repo>.git TrueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the
example-siteconfiguration to a device by updating the device specification:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The example configuration takes all the files from the
example-sitedirectory from theproductionbranch of thesite-settingsrepository and places the files in the root directory (/). - 2
- Ensure that the target path is writeable by creating your directory structure. The root directory (
/) is not writeable inbootcsystems.
6.5. Use device lifecycle hooks Copy linkLink copied to clipboard!
The Red Hat Edge Manager agent can run user-defined commands at specific points in the device lifecycle by using device lifecycle hooks. For example, you can add a shell script to your operating system images that backs up your application data. You can then specify that the script must run and complete successfully before the agent can start updating the operating system.
As another example, certain applications or system services do not automatically reload their configuration file when the file changes on the disk. You can manually reload the configuration file by specifying a command as another hook, which is called after the agent completes the update process.
The following device lifecycle hooks are supported:
| Lifecycle Hook | Description |
|---|---|
|
| This hook is called after the agent completed preparing for the update and before actually making changes to the system. If an action in this hook returns with failure, the agent cancels the update. |
|
| This hook is called after the agent has written the update to disk. If an action in this hook returns with failure,the agent cancels and rolls back the update. |
|
| This hook is called before the system reboots. The agent blocks the reboot until running the action has completed or timed out. If any action in this hook returns with failure, the agent cancels and rolls back the update. |
|
| This hook is called when the agent first starts after a reboot. If any action in this hook returns with failure, the agent reports this but continues starting up. |
6.5.1. Rule files Copy linkLink copied to clipboard!
You can define device lifecycle hooks by adding rule files to one of the following locations in the device file system:
-
Rules in the
/usr/lib/flightctl/hooks.d/<lifecycle_hook_name>/drop-in directory are read-only. To add rules to the/usrdirectory, you must add them to the operating system image during image building. -
Rules in the
/etc/flightctl/hooks.d/<lifecycle_hook_name>/drop-in directory are read-writable. You can update the rules at runtime by using several methods.
When creating and placing the files, you must consider the following practices:
- The name of the rule must be all lower case.
- If you define rules in both locations, the rules are merged.
- If you add more than one rule files to a lifecycle hook directory, the files are processed in lexical order of the file names.
-
If you define files with identical file names in both locations, the file in the
/etcfolder takes precedence over the file of the same name in the/usrfolder.
A rule file is written in YAML format and has a list of one or more actions. An action can be an instruction to run an external command.
When you specify many actions for a hook, the actions are performed in sequence, finishing one action before starting the next.
If an action returns with a failure, the following actions are skipped.
A run action takes the following parameters:
| Parameter | Description |
|
|
The absolute path to the command to run, followed by any flags or arguments, for example |
|
| Optional. A list of key-value pairs to set as environment variables for the command. |
|
| Optional. The directory the command is run from. |
|
|
Optional. The maximum duration that is allowed for the action to complete. Specify the duration as a single positive integer followed by a time unit. The |
|
| Optional. A list of conditions that must be true for the action to be run. If not provided, actions run unconditionally. |
By default, the system performs actions every time the hook is triggered. However, for the afterUpdating hook, you can use the If parameter to add conditions that must be true for an action to be performed. Otherwise, the action is skipped.
For example, to run an action only if a given file or directory changes during the update, you can define a path condition that takes the following parameters:
| Parameter | Description |
|
| An absolute path to a file or directory that must change during the update as a condition for the action to be performed. Specify paths by using forward slashes (/):
|
|
|
A list of file operations, such as |
If you specify a path condition for an action in the afterUpdating hook, you have the following variables that you can include in arguments to your command and are replaced with the absolute paths to the changed files:
| Variable | Description |
|
| The absolute path to the file or directory specified in the path condition. |
|
| A space-separated list of absolute paths of the files that changed during the update and are covered by the path condition. |
|
| A space-separated list of absolute paths of the files that were created during the update and are covered by the path condition. |
|
| A space-separated list of absolute paths of the files that were updated during the update and are covered by the path condition. |
|
| A space-separated list of absolute paths of the files that were removed during the update and are covered by the path condition. |
The Red Hat Edge Manager agent includes a built-in set of rules defined in /usr/lib/flightctl/hooks.d/afterupdating/00-default.yaml. The following commands are executed if certain files are changed:
| File | Command | Description |
|
|
|
Changes to |
|
|
|
Changes to |
|
|
|
Changes to the permanent configuration of |
Additional resources
6.6. Monitor device resources Copy linkLink copied to clipboard!
You can set up monitors for device resources and define alerts when the use of these resources crosses a defined threshold. When the agent alerts the Red Hat Edge Manager service, the service sets the device status to "degraded" or "error" (depending on the severity level).
Resource monitors take the following parameters:
| Parameter | Description |
|---|---|
| MonitorType | The resource to monitor. Currently supported resources are "CPU", "Memory", and "Disk". |
| SamplingInterval | The interval in which the monitor samples use, specified as positive integer followed by a time unit ("s" for seconds, "m" for minutes, "h" for hours). |
| AlertRules | A list of alert rules. |
| Path | (Disk monitor only) The absolute path to the directory to monitor. Utilization reflects the filesystem containing the path, similar to df, even if it’s not a mount point. |
Alert rules take the following parameters:
| Parameter | Description |
|---|---|
| Severity | The alert rule’s severity level out of "Info", "Warning", or "Critical". Only one alert rule is allowed per severity level and monitor. |
| Duration | The duration that resource use is measured and averaged over when sampling, specified as positive integer followed by a time unit ("s" for seconds, "m" for minutes, "h" for hours). It must be smaller than the sampling interval. |
| Percentage | The use threshold that triggers the alert, as percentage value (range 0 to 100 without the "%" sign). |
| Description | A human-readable description of the alert. This is useful for adding details about the alert that might help with debugging. By default it populates the alert as : load is above >% for more than. |
6.6.1. Monitoring device resources on the CLI Copy linkLink copied to clipboard!
Monitor the resources of your device through the CLI, providing you with the tools and commands to track performance and troubleshoot issues.
Procedure
Add resource monitors in the
resources:section of the device’s specification.For example, add the following monitor for your disk:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 7. Managing applications on an edge device Copy linkLink copied to clipboard!
You can deploy, update, or remove applications on a device by updating the list of applications in the device specification. When the Red Hat Edge Manager agent checks in and detects the change in the specification, the agent downloads any new or updated application packages and images from an Open Container Initiative (OCI)-compatible registry. Then, the agent deploys the packages to the appropriate application runtime or removes them from that runtime.
The Red Hat Edge Manager supports the podman-compose tool as the application runtime and format.
For more information, see Building a bootc operating system image for use with the Red Hat Edge Manager.
7.1. Building an application package image Copy linkLink copied to clipboard!
The Red Hat Edge Manager can download application packages from an Open Container Initiative (OCI) compatible registry. You can build an OCI container image that includes your application package in the podman-compose format and push the image to your OCI registry.
Prerequisites
- You must install the Red Hat Edge Manager CLI.
- You must log in to the Red Hat Edge Manager service.
-
Your device must run an operating system image with the
podman-composetool installed.
Procedure
Define the functionality of the application in a file called
podman-compose.yamlthat follows the Podman Compose specification:Create a file called
Containerfilewith the following content:FROM scratch COPY podman-compose.yaml /podman-compose.yaml LABEL appType="compose"
FROM scratch1 COPY podman-compose.yaml /podman-compose.yaml LABEL appType="compose"2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Build and push the container image to your OCI registry:
Define the image repository that you have permissions to write to by running the following command:
OCI_IMAGE_REPO=quai.io/<your_org>/<your_image>
OCI_IMAGE_REPO=quai.io/<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 application container image by running the following command:
podman build -t ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG} .podman build -t ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG} .Copy to Clipboard Copied! Toggle word wrap Toggle overflow Push the container image by running the following command:
podman push ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG} .podman push ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG} .Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.2. Specify applications inline in the device specification Copy linkLink copied to clipboard!
Application manifests are specified inline in a device’s specification, so you do not need to build an OCI registry application package.
The inline application provider accepts a list of application content with the following parameters:
| Parameter | Description |
| Path | The relative path to the file on the device. Note that any existing file is overwritten. |
| Content (Optional) | The plain text (UTF-8) or base64-encoded content of the file. |
| ContentEncoding | How the contents are encoded. Must be either "plain" or "base64". Defaults to "plain". |
Example
Inline compose applications can have two paths at most. You must name the first one podman-compose.yaml, and the second (override) podman-compose.override.yaml.
7.3. Deploying applications to a device using the CLI Copy linkLink copied to clipboard!
Deploy an application package to a device from an OCI registry by using the CLI.
Complete the following steps:
Procedure
Specify the application package that you want to deploy in the
spec.applicationsfield in theDeviceresource:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteFor each application in the
applicationssection of the device specification, you can find the corresponding device status information.Verify the status of an application deployment on a device by inspecting the device status information by running the following command:
flightctl get device/<your_device_id> -o yaml
flightctl get device/<your_device_id> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 8. Device fleets Copy linkLink copied to clipboard!
The Red Hat Edge Manager simplifies the management of a large number of devices and workloads through device fleets. A fleet is a resource that defines a group of devices governed by a common device template and management policies.
When you make a change to the device template, all devices in the fleet receive the changes when the Red Hat Edge Manager agent detects the new target specification.
Device monitoring in a fleet is also simplified because you can check the status summary of the whole fleet.
Fleet-level management offers the following advantages:
- Scales your operations because you perform operations only once for each fleet instead of once for each device.
- Minimizes the risk of configuration mistakes and configuration drift.
Automatically applies the target configuration when you add devices to the fleet or replace devices in the fleet. The fleet specification consists of the following features:
- Label selector
- Determines which devices are part of the fleet.
- Device template
- Defines the configuration that the Red Hat Edge Manager enforces on devices in the fleet.
- Policies
- Governs how devices are managed, for example, how changes to the device template are rolled out to the devices.
You can have both individually managed and fleet-managed devices at the same time.
When you select a device into a fleet, the Red Hat Edge Manager creates the device specification for the new device based on the device template. If you update the device template for a fleet or a new device joins the fleet, the Red Hat Edge Manager enforces the new specification in the fleet.
If a device is not selected into any fleets, the device is considered user-managed or unmanaged. For user-managed devices, you must update the device specification either manually or through an external automation.
A device cannot be a member of more than one fleet at the same time.
For more information, see Labels and label selectors.
8.1. Device selection into a fleet Copy linkLink copied to clipboard!
By default, devices are not assigned to a fleet. Instead, each fleet uses a selector that defines which labels a device must have to be added to the fleet.
To understand how to use labels in a fleet, see the following example.
The following list shows point-of-sales terminal devices and their labels:
| Device | Labels |
| A |
|
| B |
|
| C |
|
| D |
|
If all point-of-sale terminals use the same configuration and are managed by the same operations team, you can define a single fleet called pos-terminals with the type=pos-terminal label selector. Then, the fleet contains devices A, B, C, and D.
However, you might want to create separate fleets for the different organizations for development or production. You can define a fleet for development with the type=pos-terminal, stage=development label selector, which selects devices C and D. Then, you can define another fleet for production with the type=pos-terminal, stage=production label selector. By using the correct label selectors, you can manage both fleets independently.
You must define selectors in a way that two fleets do not select the same device. For example, if one fleet selects region=east, and another fleet selects stage=production, both fleets try to select device A. If two fleets try to select the same device, the Red Hat Edge Manager keeps the device in the currently assigned fleet, if any, and sets the OverlappingSelectors condition on the affected fleets to true.
8.2. Device templates Copy linkLink copied to clipboard!
A device template of a fleet contains a device specification that is applied to all devices in the fleet when the template is updated.
For example, you can specify in the device template of a fleet that all devices in the fleet must run the quay.io/flightctl/rhel:9.5 operating system image.
The Red Hat Edge Manager service then rolls out the target specification to all devices in the fleet, and the Red Hat Edge Manager agents update each device.
You can change other specification items in the device template and the Red Hat Edge Manager applies the changes in the same way.
However, sometimes not all of the devices in the fleet need to have the exact same specification. The Red Hat Edge Manager allows templates to contain placeholders that are populated based on the device name or label values.
The syntax of the placeholders matches that of Go templates. However, you can only use simple text and actions.
The use of conditionals or loops in the placeholders is not supported.
You can reference anything from the metadata of a device, such as {{ .metadata.labels.key }} or {{ .metadata.name }}.
You can also use the following functions in your placeholders:
-
The
upperfunction changes the value to uppercase. For example, the function is{{ upper .metadata.name }}. -
The
lowerfunction changes the value to lowercase. For example, the function is{{ lower .metadata.labels.key }}. -
The
replacefunction replaces all occurrences of a substring with another string. For example, the function is{{ replace "old" "new" .metadata.labels.key }}. -
The
getOrDefaultfunction returns a default value if accessing a missing label. For example, the function is{{ getOrDefault .metadata.labels "key" "default" }}. You can combine the functions in pipelines, for example, a combined function is{{ getOrDefault .metadata.labels "key" "default" | upper | replace " " "-" }}.
Ensure you are using proper Go template syntax. For example, {{ .metadata.labels.target-revision }} is not valid because of the hyphen. Instead, you must refer to the field as {{ index .metadata.labels "target-revision" }}.
You can use the placeholders in device templates in the following ways:
-
You can label devices by deployment stage, for example, stage labels are
stage: testingandstage: production. Then, you can use the label with thestagekey as placeholder when referencing the operating system image to use, for example, usequay.io/myorg/myimage:latest-{{ .metadata.labels.stage }}or when referencing a configuration folder in a Git repository. -
You can label devices by deployment site, for example, deployment sites are
site: factory-berlinandsite: factory-madrid. Then, you can use the label with the
sitekey as parameter when referencing the secret with network access credentials in Kubernetes. The following fields in device templates support placeholders:Expand Field
Placeholders supported in
Operating System Image
repository name, image name, image tag
Git Config Provider
target revision, path
HTTP Config Provider
URL suffix, path
Inline Config Provider
content, path
8.3. Adding devices to a fleet on the web UI Copy linkLink copied to clipboard!
Define the label selector to add devices into a fleet on the web UI.
Complete the following tasks:
Procedure
- From the navigation panel, select → . This opens the external Edge Manager instance.
- From the navigation panel, select Fleets. Select the fleet that you want to add devices to.
- Click and select Edit fleet.
- In the General info tab, click Add label under the Device selector option.
- Add the label to select devices for your fleet. Any devices with that label are added to the fleet.
8.4. Adding devices to a fleet on the CLI Copy linkLink copied to clipboard!
Define the label selector to add devices into a fleet.
Complete the following tasks:
Procedure
Run the following command to verify that the label selector returns the devices that you want to add to the fleet:
flightctl get devices -l type=pos-terminal -l stage=development
flightctl get devices -l type=pos-terminal -l stage=developmentCopy to Clipboard Copied! Toggle word wrap Toggle overflow If running the command returns the expected list of devices, you can define a fleet that selects the devices by using the following YAML file:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the change by running the following command:
flightctl apply -f my_fleet.yaml
flightctl apply -f my_fleet.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check for any overlaps with the selector of other fleets by running the following command:
flightctl get fleets/my_fleet -o json | jq -r '.status.conditions[] | select(.type=="OverlappingSelectors").status'
flightctl get fleets/my_fleet -o json | jq -r '.status.conditions[] | select(.type=="OverlappingSelectors").status'Copy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output:
False
FalseCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.5. Rollout device selection Copy linkLink copied to clipboard!
When performing a rollout by using flightctl, you must manage which devices participate in the rollout and how much disruption is acceptable. The device selection process and the rollout disruption budget concept ensure controlled and predictable rollouts.
The process and configuration for selecting devices during a rollout includes targeting strategies, batch sequencing, and success criteria for controlled software deployment.
8.5.1. Device targeting Copy linkLink copied to clipboard!
A rollout applies only to devices that belong to a fleet. Each device can belong to only a single fleet. Since rollout definitions are done at the fleet level, the selection process determines which devices within a fleet that participate in a batch rollout based on label criteria. After processing all batches, all fleet devices are rolled out.
- Labels: Devices with specific metadata labels can be targeted for rollouts.
- Fleet membership: Rollouts apply only to devices within the specified fleet.
8.5.2. Device selection strategy Copy linkLink copied to clipboard!
The Red Hat Edge Manager supports only the BatchSequence strategy for device selection. This strategy defines a stepwise rollout process where devices are added in batches based on specific criteria. Batches are executed sequentially. After each batch completes, execution proceeds to the next batch only if the success rate of the previous batch meets or exceeds the configured success threshold.
The success rate is determined as:
of successful rollouts in the batch / # of devices in the batch >= success threshold
# of successful rollouts in the batch / # of devices in the batch >= success threshold
In a batch sequence, the final batch is an implicit batch and it is not specified in the batch sequence. It selects all devices in a fleet that have not been selected by the explicit batches in the sequence.
8.5.3. Limit in device selection Copy linkLink copied to clipboard!
Each batch in the BatchSequence strategy might use an optional limit parameter to define how many devices should be included in the batch. You can specify the limit can in two ways:
- Absolute number: A fixed number of devices to be selected.
Percentage: The percentage of the total matching device population to be selected.
-
If you provide a
selectorwith labels, the percentage is calculated based on the number of devices that match the label criteria within the fleet. -
If you do not provide a
selector, the percentage is applied to all devices in the fleet.
-
If you provide a
8.5.4. Success threshold Copy linkLink copied to clipboard!
The successThreshold defines the percentage of successfully updated devices required to continue the rollout. If the success rate falls below this threshold, the rollout might be paused to prevent further failures.
Example
The following shows an example YAML configuration for a fleet specification:
In this example, there are 6 explicit batches and 1 implicit batch:
- The first batch selects 1 device having a label site:madrid.
- With the second batch 80% of all devices having the label site:madrid are either selected for rollout in the current batch or were previously selected for rollout.
- With the third batch 50% of all devices are either selected for rollout in the current batch or were previously selected for rollout.
- With the fourth batch all devices that were not previously selected and have the label site:paris are selected.
- With the fifth batch 80% of all devices are either selected for rollout in the current batch or were previously selected for rollout.
- With the sixth batch 100% of all devices are either selected for rollout in the current batch or were previously selected for rollout.
- The last implicit batch selects all devices that have not been selected in any previous batch (might be none).
8.6. Rollout disruption budget Copy linkLink copied to clipboard!
A rollout disruption budget defines the acceptable level of service impact during a rollout. This ensures that a deployment does not take down too many devices at once, maintaining overall system stability.
8.6.1. Disruption budget parameters Copy linkLink copied to clipboard!
-
groupBy: Defines how devices are grouped when applying the disruption budget. The grouping is done by label keys. -
minAvailable: Specifies the minimum number of devices that must remain available during a rollout. -
maxUnavailable: Limits the number of devices that can be unavailable at the same time.
Example
The following shows an example YAML configuration for a fleet specification:
In this example, the grouping is performed on 2 label keys: site and function. A group for disruption budget consists of all devices in a fleet having the same label values for the preceding label keys. For every such group the conditions defined in this specification are continuously enforced.
Chapter 9. Troubleshooting Red Hat Edge Manager Copy linkLink copied to clipboard!
When working with devices in Red Hat Edge Manager, you might see issues related to configuration, connectivity, or deployment. Troubleshooting these issues requires understanding how device configurations are applied, how to check logs, and how to verify communication between the device and the service.
9.1. Viewing a device’s effective target configuration Copy linkLink copied to clipboard!
The device manifest returned by the flightctl get device command still only has references to external configuration and secret objects. Only when the device agent queries the service, the service replaces the references with the actual configuration and secret data. While this better protects potentially sensitive data, it also makes troubleshooting faulty configurations hard. This is why a user can be authorized to query the effective configuration as rendered by the service to the agent.
Procedure
To query the effective configuration, use the following command:
flightctl get device/${device_name} --rendered | jqflightctl get device/${device_name} --rendered | jqCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.2. Generating a device log bundle Copy linkLink copied to clipboard!
The device includes a script that generates a bundle of logs necessary to debug the agent.
Procedure
Run the following command on the device and include the .tar file in the bug report.
NoteThis depends on an SSH connection to extract the .tar file.
sudo flightctl-must-gather
sudo flightctl-must-gatherCopy to Clipboard Copied! Toggle word wrap Toggle overflow