Chapter 3. Building an application package
Red Hat Edge Manager downloads application packages as OCI artifacts from an OCI-compatible registry. Using this structure, you can package and deploy workloads in various native formats.
Red Hat Edge Manager supports three application types across two distinct runtimes:
Podman runtime (edge device):
-
quadlet: Podman Quadlet and systemd workloads -
container: Single-container workloads
MicroShift runtime (edge device):
-
helm: Helm chart workloads
3.1. Build a Podman application package (OCI artifact) Copy linkLink copied to clipboard!
For quadlet and container applications, you package your configuration files into an OCI artifact. The Red Hat Edge Manager agent uses the artifact to identify the application type and extract the configuration to the device’s Podman runtime.
Supported Quadlet types: The Red Hat Edge Manager agent supports the following Quadlet file extensions within an artifact:
-
.container: Defines a containerized service. -
.volume: Defines a Podman named volume. -
.network: Defines a container network. -
.image: Defines a container image (for pre-pulling). -
.pod: Defines a pod (group of containers).
Procedure
Prepare your application configuration: Create the configuration file required for your chosen format (for example,
application.container). Ensure that you define any persistent data requirements by using volumes within these configuration files.NoteTo ensure Quadlet services restart automatically after a device reboot, include an
[Install]section in your.containerfile (for example,WantedBy=default.target).Create the OCI artifact: Use the
podman artifact addcommand to package your configuration.For a single file, run:
podman artifact add quay.io/<your_org>/<your_image_name>:v1 application.containerFor multiple files, bundle them into a compressed archive first. Create the archive:
tar czf app-bundle.tar.gz application.container config.jsonAdd the archive to the artifact:
podman artifact add quay.io/<your_org>/<your_image_name>:v1 app-bundle.tar.gzNotePodman version 5.5 or later is required for the
artifactcommand. The Red Hat Edge Manager agent automatically extracts.tar.gz,.tar, and.tgzarchives into the application directory on the edge device.Push the artifact to your registry: Upload the packaged artifact to your OCI-compatible registry:
podman artifact push quay.io/<your_org>/<your_image_name>:v1
3.2. Add application volumes Copy linkLink copied to clipboard!
You can define volumes in the device specification to persist data or to mount data from secondary OCI artifacts. For quadlet applications, only artifact-backed mounts are supported, because Quadlets define persistent storage natively in the Quadlet file. For container applications, you can use either artifact-backed mounts or persistent storage.
With artifact-backed volumes, you can mount the contents of a separate OCI image (containing models, datasets, or static files) into your application without rebuilding your main application image.
Procedure
Update the device specification: Reference the OCI artifact in the
imagefield of your device resource. You can define and override runtime configurations such as environment variables, ports, and volumes in the device specification.spec: applications: - name: sensor-collector appType: quadlet image: quay.io/myorg/sensor-collector:v1 envVars: SENSOR_ID: "unit-42" volumes: - name: model-data image: reference: quay.io/myorg/sensor-models:latest pullPolicy: IfNotPresent reclaimPolicy: Retain runAs: flightctl
3.3. Podman application lifecycle on the device Copy linkLink copied to clipboard!
For quadlet and container applications, the Red Hat Edge Manager agent manages the full lifecycle of the workload by using the local Podman runtime and systemd.
- Install
- The agent pulls the OCI artifact, extracts the configuration files to the host, and initializes the service through Podman. Finally, the agent reports the container status back to the service.
- Upgrade
-
When you update the
imagereference or inline configuration (such asenvVars) in the device specification, the agent pulls the new artifact if it changed. The agent then replaces the existing configuration files and restarts the service. - Uninstall
- When you remove a Podman-based application from the device specification, the agent stops the associated containers and removes the configuration files from the device.
3.4. Build a Helm application package (OCI artifact) Copy linkLink copied to clipboard!
For Helm applications, you package your Helm chart as an OCI artifact. Helm 3.8+ supports storing and retrieving charts from OCI registries directly. The agent uses the chart reference from the device specification to pull and deploy the chart to MicroShift.
Procedure
Package and push the chart:
helm package .Push the chart to your registry:
helm push <chart_package.tgz> oci://quay.io/<your_org>/<your_chart_name>Configure the device specification: To customize a Helm application, provide configuration overrides directly in the
Deviceresource by using thevaluesorvaluesFilesfields.applications: - name: wordpress appType: helm image: quay.io/myorg/my-chart:1.0.0 values: replicaCount: 2
3.5. Helm application lifecycle on the device Copy linkLink copied to clipboard!
For Helm applications, the Red Hat Edge Manager agent manages the full lifecycle of the Helm release on MicroShift.
- Install
- To install, add a Helm application to the device specification. The agent then pulls the chart from the OCI reference and installs it on MicroShift.
- Upgrade
-
When you update the image reference or configuration (such as
valuesorvalueFiles), the agent performs a Helm upgrade. This keeps the release on the device synchronized with your required state. - Uninstall
- When you remove a Helm application from the device specification, the agent uninstalls the Helm release from MicroShift.