Manage the device configuration from a Git repository on the CLI

Create and apply a device configuration in a Git repository.

Complete the following steps:

  1. Create a file, for example site-settings-repo.yaml, that contains the following definition for a Repository resource, named site-settings:
    apiVersion: flightctl.io/v1alpha1
    kind: Repository
    metadata:
      name: site-settings
    spec:
      type: git
      url: https://github.com/<your_org>/<your_repo>.git
  2. Create the Repository resource by running the following command:
    flightctl apply -f site-settings-repo.yaml
  3. Verify that the resource has been correctly created and is accessible by Red Hat Edge Manager by running the following command:
    flightctl get repository/site-settings

    See the following example output:

    NAME           TYPE  REPOSITORY URL                                 ACCESSIBLE
    site-settings  git   https://github.com/<your_org>/<your_repo>.git  True
  4. Apply the example-site configuration to a device by updating the device specification:
    apiVersion: flightctl.io/v1alpha1
    kind: Device
    metadata:
      name: <device_name>
    spec:
      config:
        - name: example-site
          gitRef:
            repository: site-settings
            targetRevision: production
            path: /etc/example-site
    [...]

After the repository is referenced from a fleet or device, Red Hat Edge Manager can poll the repository for changes. When you push commits to the tracked branch, Red Hat Edge Manager rolls out the new configuration. You do not need to edit the fleet or device specification to pick up Git changes. For details, see Automatic synchronization of external configuration in the Additional resources section.