70 lines
1.8 KiB
Markdown
70 lines
1.8 KiB
Markdown
# NFS Client Provisioner
|
|
|
|
Provides shared NFS storage to the cluster by creating a StorageClass and PersistentVolume backed by an external NFS server. This is an infrastructure app — it has no pods or namespace, just cluster-scoped resources.
|
|
|
|
## Prerequisites
|
|
|
|
You need an NFS server already running and exporting a path. To set one up on a host:
|
|
|
|
```bash
|
|
./setup-nfs-host.sh <host> <media-path>
|
|
```
|
|
|
|
Example:
|
|
|
|
```bash
|
|
./setup-nfs-host.sh box-01 /srv/nfs
|
|
```
|
|
|
|
This SSHs into the host, installs `nfs-kernel-server`, and configures the export.
|
|
|
|
## Configuration
|
|
|
|
When added to an instance, the default config is merged into `config.yaml`:
|
|
|
|
```yaml
|
|
apps:
|
|
nfs:
|
|
host: "192.168.1.100"
|
|
mediaPath: "/mnt/storage/media"
|
|
storageCapacity: "1Ti"
|
|
```
|
|
|
|
Update `host` and `mediaPath` to match your NFS server before deploying.
|
|
|
|
## What Gets Deployed
|
|
|
|
- **StorageClass** (`nfs`) — allows PVCs to request NFS-backed storage
|
|
- **PersistentVolume** (`nfs-media-pv`) — a cluster-wide volume pointing to the NFS export
|
|
|
|
No namespace, pods, or services are created.
|
|
|
|
## Scripts
|
|
|
|
- **check-nfs** — Verifies the NFS server is reachable, the export path exists, and checks whether the StorageClass and PersistentVolume are present in the cluster. Run from the app detail panel in the web UI.
|
|
|
|
## Usage
|
|
|
|
Applications can use NFS storage by setting `storageClassName: nfs` in their PVCs:
|
|
|
|
```yaml
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: media-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
storageClassName: nfs
|
|
resources:
|
|
requests:
|
|
storage: 100Gi
|
|
```
|
|
|
|
## Features
|
|
|
|
- Cluster-wide access — any pod can mount the NFS share regardless of node placement
|
|
- ReadWriteMany — multiple pods can simultaneously read and write
|
|
- Configurable capacity — set PersistentVolume size via `storageCapacity`
|
|
- Retain policy — data is preserved when volumes are released
|