- controller.nomad: CSI controller pinned to int - node.nomad: CSI node plugin (int only for now, expand later) - volumes/example.hcl: template for creating new volumes NFS: int exports /opt/csi-volumes to 192.168.15.0/24 Plugin ID: org.democratic-csi.nfs
56 lines
1.2 KiB
Markdown
56 lines
1.2 KiB
Markdown
# nomad-csi
|
|
|
|
Nomad CSI storage for i80.dk — democratic-csi + NFS on int.i80.dk.
|
|
|
|
## Architecture
|
|
|
|
- **NFS server**: `int.i80.dk` exports `/opt/csi-volumes` to 192.168.15.0/24
|
|
- **CSI driver**: [democratic-csi](https://github.com/democratic-csi/democratic-csi) v1.9.0
|
|
- **Plugin ID**: `org.democratic-csi.nfs`
|
|
|
|
## Deploy
|
|
|
|
```bash
|
|
# One-time: deploy CSI controller + node plugin
|
|
nomad job run csi/controller.nomad
|
|
nomad job run csi/node.nomad
|
|
|
|
# Verify
|
|
nomad plugin status org.democratic-csi.nfs
|
|
```
|
|
|
|
## Create a volume
|
|
|
|
```bash
|
|
# Edit csi/volumes/example.hcl with your id/name/size, then:
|
|
nomad volume create csi/volumes/my-volume.hcl
|
|
|
|
# Volumes are persistent — only deleted explicitly:
|
|
nomad volume delete my-volume-id
|
|
```
|
|
|
|
## Use in a job
|
|
|
|
```hcl
|
|
volume "data" {
|
|
type = "csi"
|
|
source = "my-volume-id"
|
|
access_mode = "single-node-writer"
|
|
attachment_mode = "file-system"
|
|
}
|
|
|
|
# ...in the task:
|
|
volume_mount {
|
|
volume = "data"
|
|
destination = "/data"
|
|
}
|
|
```
|
|
|
|
## Expanding to all workers
|
|
|
|
When ready, update `csi/node.nomad`:
|
|
- Change `type = "service"` → `type = "system"`
|
|
- Remove the `constraint` block
|
|
|
|
Workers need `nfs-common` installed (via Ansible `storage.yml` playbook).
|