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:
- Create a file, for example
site-settings-repo.yaml, that contains the following definition for aRepositoryresource, namedsite-settings:apiVersion: flightctl.io/v1alpha1 kind: Repository metadata: name: site-settings spec: type: git url: https://github.com/<your_org>/<your_repo>.git - Create the
Repositoryresource by running the following command:flightctl apply -f site-settings-repo.yaml - 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-settingsSee the following example output:
NAME TYPE REPOSITORY URL ACCESSIBLE site-settings git https://github.com/<your_org>/<your_repo>.git True - Apply the
example-siteconfiguration 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.