Chapter 7. Managing applications on an edge device


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

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-compose tool installed.

Procedure

  1. Define the functionality of the application in a file called podman-compose.yaml that follows the Podman Compose specification:

    • Create a file called Containerfile with the following content:

      FROM scratch 
      1
      
      COPY podman-compose.yaml /podman-compose.yaml
      LABEL appType="compose" 
      2
      Copy to Clipboard Toggle word wrap
      1
      Embed the compose file in a scratch container.
      2
      Add the appType=compose label.
  2. Build and push the container image to your OCI registry:

    1. 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>
      Copy to Clipboard Toggle word wrap
    2. Define the image tag by running the following command:

      OCI_IMAGE_TAG=v1
      Copy to Clipboard Toggle word wrap
    3. Build the application container image by running the following command:

      podman build -t ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG} .
      Copy to Clipboard Toggle word wrap
    4. Push the container image by running the following command:

      podman push ${OCI_IMAGE_REPO}:${OCI_IMAGE_TAG} .
      Copy to Clipboard Toggle word wrap

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:

Expand

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

apiVersion: flightctl.io/v1alpha1
kind: Device
metadata:
  name: some_device_name
spec:
[...]
  applications:
    - name: my-app
      appType: compose
      inline:
        - content: |
            version: "3.8"
            services:
              service1:
                image:  quay.io/flightctl-tests/alpine:v1
                command: ["sleep", "infinity"]
          path: podman-compose.yaml
[...]
Copy to Clipboard Toggle word wrap
Note

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.

Deploy an application package to a device from an OCI registry by using the CLI.

Complete the following steps:

Procedure

  1. Specify the application package that you want to deploy in the spec.applications field in the Device resource:

    apiVersion: flightctl.io/v1alpha1
    kind: Device
    metadata:
      name: <device_name>
    spec:
    [...]
      applications:
      - name: wordpress 
    1
    
        image: quay.io/rhem-demos/wordpress-app:latest 
    2
    
        envVars: 
    3
    
          WORDPRESS_DB_HOST: <database_host>
          WORDPRESS_DB_USER: <user_name>
          WORDPRESS_DB_PASSWORD: <password>
    [...]
    Copy to Clipboard Toggle word wrap
    1
    A user-defined name for the application that is used when the web console and the CLI list applications.
    2
    A reference to an application package in an OCI registry.
    3
    Optional. A list of key-value pairs that are passed to the deployment tool as environment variables or command line flags.
    Note

    For each application in the applications section of the device specification, you can find the corresponding device status information.

  2. 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
    Copy to Clipboard Toggle word wrap

    See the following example output:

    [...]
    spec:
      applications:
      - name: example-app
        image: quay.io/flightctl-demos/example-app:v1
    status:
      applications:
      - name: example-app
        ready: 3/3
        restarts: 0
        status: Running
      applicationsSummary:
        info: All application workloads are healthy.
        status: Healthy
    [...]
    Copy to Clipboard Toggle word wrap
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat