Deploy and verify applications

After you build and push your application package image, you can deploy it to a device and verify the deployment status by using the Flight Control CLI.

Before you begin

  • If you specify runAs: flightctl (or another non-root user) for container or quadlet applications, the user must exist on the device. Create the user in your bootc operating system image. See Build a bootc operating system image for how to add user creation to your Containerfile.

Procedure

  1. Specify the application package: In the spec.applications field of the Device resource, define the application that you want to deploy.

    For Container, Quadlet, Compose, and Helm application types, reference an OCI image directly with the image field:

    apiVersion: flightctl.io/v1beta1
    kind: Device
    metadata:
      name: <device_name>
    spec:
      applications:
      - name: wordpress
        appType: container
        image: quay.io/rhem-demos/wordpress-app:latest
        runAs: flightctl
        envVars:
          WORDPRESS_DB_HOST: <database_host>
          WORDPRESS_DB_USER: <user_name>
          WORDPRESS_DB_PASSWORD: <password>

    Alternatively, to deploy an application from the Software Catalog, use the catalogItemRef field instead of image:

    apiVersion: flightctl.io/v1beta1
    kind: Device
    metadata:
      name: <device_name>
    spec:
      applications:
      - name: wordpress
        appType: container
        catalogItemRef:
          catalog: <catalog_name>
          item: <app_item_name>
          version: "<version>"
          channel: "<channel (optional)>"
        runAs: flightctl
        envVars:
          WORDPRESS_DB_HOST: <database_host>
          WORDPRESS_DB_USER: <user_name>
          WORDPRESS_DB_PASSWORD: <password>

    The image and catalogItemRef fields are mutually exclusive. The catalogItemRef field replaces only the image field and does not affect appType, envVars, runAs, or other application specification fields.

    Note

    The image and catalogItemRef fields apply to Container, Quadlet, Compose, and Helm application types. VM applications use neither field and must specify their configuration as an inline vm.yaml file. For VM application deployment, see Deploying VM applications in the Additional resources section.

    For the complete field specification, see Catalog item reference field specification.

    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: Inspect the device status to confirm that the deployment succeeded. Run the following command:
    flightctl get device/<your_device_id> -o yaml

    Example output:

    spec:
      applications:
      - name: example-app
        image: quay.io/flightctl-demos/example-app:v1
        appType: container
        runAs: flightctl
    status:
      applications:
      - name: example-app
        ready: 3/3
        restarts: 0
        status: Running
      applicationsSummary:
        info: All application workloads are healthy.
        status: Healthy