This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbalena.yml
94 lines (73 loc) · 4.11 KB
/
balena.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: balena-nfs
version: 1.3.0
joinable: false
type: sw.application
description: >-
The Balena NFS project demonstrates how to deploy NFS Server and Client in balenaCloud.
post-provisioning: >-
![Diagram](https://raw.githubusercontent.com/volkovlabs/balena-nfs/main/img/balena-nfs.png)
[![Grafana 9](https://img.shields.io/badge/Grafana-9.2.2-orange)](https://www.grafana.com)
[![Balena](https://github.com/volkovlabs/balena-nfs/actions/workflows/balena.yml/badge.svg)](https://github.com/volkovlabs/balena-nfs/actions/workflows/balena.yml)
## Introduction
The Balena NFS project demonstrates how to deploy the NFS Server and Client in balenaCloud.
Read more in the Balena blog post, "[Using NFS Server to share external storage between containers](https://www.balena.io/blog/using-nfs-server-to-share-external-storage-between-containers-balena/)".
[![Using Network File System (NFS) in Balena | Share external storage between containers](https://raw.githubusercontent.com/volkovlabs/balena-nfs/main/img/video.png)](https://youtu.be/_kyNSLeAT84)
### Requirements
- **balenaOS 2.105.10** is required for Nvidia Jetson AGX Orin Devkit with NFS version 4.
- **balenaOS 2.99.27+rev1** is required for NFS version 4.
- **balenaOS 2.98** is required for NFS version 3.
## Features
- Includes a NFS Server build on top of the PostgreSQL Alpine image using OpenRC to manage NFS services.
- Supports various environment variables to specify storage label, mount point, etc.
- Includes a NFS Client build on top of the NGINX Alpine image using custom Entrypoint script to mount NFS export.
- Provides Grafana Dashboard to manage running services and display configuration using Supervisor API. Default Grafana username and password is **admin/admin**.
- Supports NFS version 4 and version 3. NFS version 4 is set by default.
- Allows to set NFS in `sync` or `async` modes.
## Tested
- Nvidia Jetson AGX Orin Devkit (jetson-agx-orin-devkit)
- Raspberry Pi4-64 (raspberrypi4-64)
- Jetson Xavier (jetson-xavier)
- x86-64 (genericx86-64-ext)
## Environment Variables
- STORAGE_LABEL (storage) - External Storage ID, if not found `tmpfs` will be used instead.
- STORAGE_MOUNT_POINT (/mnt/nvme) - Local mount point to mount Storage or `tmpfs`.
- POSTGRES_PASSWORD (postgres) - Password for the PostgreSQL database.
- PGDATA (/mnt/nvme/postgresql/data) - PostgreSQL path on the Storage or `tmpfs` mount point.
- NFS_HOST (localhost) - NFS host, should be `localhost` for the local container.
- NFS_HOST_MOUNT (/) - NFS exported mount. Set full path `/mnt/nvme` for NFS version 3.
- NFS_MOUNT_POINT (/mnt/nvme) - Mount point to mount NFS export.
- NFS_SYNC_MODE (async) - Async or Sync mode.
- NFS_VERSION (nfs) - Set `nfs4` to force use NFS version 4.
### NFS version 3
To support NFS version 3 please update Environment Variables:
![Diagram](https://raw.githubusercontent.com/volkovlabs/balena-nfs/main/img/env-nfsv3.png)
## Balena Application
The [Balena Application](https://github.com/VolkovLabs/volkovlabs-balena-app) for Grafana allows to display device information and manage services using Balena Supervisor API.
Working in a productive alliance, Balena, Grafana, and the Balena Application plugin simplify managing a network of non-homogenous IoT devices.
![Balena Application](https://raw.githubusercontent.com/volkovlabs/balena-nfs/main/img/balena-app.png)
assets:
repository:
type: blob.asset
data:
url: "https://github.com/VolkovLabs/balena-nfs"
logo:
type: blob.asset
data:
url: "https://raw.githubusercontent.com/VolkovLabs/balena-nfs/main/img/logo.png"
data:
applicationEnvironmentVariables:
- STORAGE_LABEL: storage
- STORAGE_MOUNT_POINT: /mnt/nvme
- POSTGRES_PASSWORD: postgres
- PGDATA: /mnt/nvme/postgresql/data
- NFS_HOST: localhost
- NFS_HOST_MOUNT: /
- NFS_MOUNT_POINT: /mnt/nvme
- NFS_SYNC_MODE: async
- NFS_VERSION: nfs
defaultDeviceType: jetson-agx-orin-devkit
supportedDeviceTypes:
- raspberrypi4-64
- jetson-xavier
- genericx86-64-ext
- jetson-agx-orin-devkit