7.3. 使用 CLI 将应用程序部署到设备
使用 CLI 从 OCI 注册表将应用程序软件包部署到设备。
完成以下步骤:
流程
在
Device
资源的spec.applications
字段中指定要部署的应用程序软件包:apiVersion: flightctl.io/v1alpha1 kind: Device metadata: name: <device_name> spec: [...] applications: - name: wordpress image: quay.io/rhem-demos/wordpress-app:latest envVars: WORDPRESS_DB_HOST: <database_host> WORDPRESS_DB_USER: <user_name> WORDPRESS_DB_PASSWORD: <password> [...]
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 Copied! 注意对于设备规格
的应用程序
部分中的每个应用程序,您可以找到对应的设备状态信息。运行以下命令,检查设备状态信息,验证设备上的应用程序部署的状态:
flightctl get device/<your_device_id> -o yaml
flightctl get device/<your_device_id> -o yaml
Copy to Clipboard Copied! 请参见以下示例输出:
[...] 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 [...]
[...] 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 Copied!