Files
nomad-csi/csi/controller.nomad
Henrik Jess Nielsen 90ff2f2480 Initial CSI setup — democratic-csi + NFS on int
- 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
2026-05-26 23:22:55 +02:00

70 lines
1.5 KiB
HCL

job "csi-nfs-controller" {
datacenters = ["dc1"]
type = "service"
namespace = "default"
# Pin controller to int — NFS server lives here
constraint {
attribute = "${node.unique.name}"
value = "int"
}
group "controller" {
count = 1
task "plugin" {
driver = "docker"
config {
image = "democraticcsi/democratic-csi:latest"
command = "/bin/democratic-csi"
args = [
"--csi-version=1.5.0",
"--csi-name=org.democratic-csi.nfs",
"--driver-config-file=${NOMAD_TASK_DIR}/driver-config-file.yaml",
"--log-level=info",
"--csi-mode=controller",
"--server-socket=${CSI_ENDPOINT}",
]
volumes = [
"/opt/csi-volumes:/opt/csi-volumes",
]
privileged = true
}
csi_plugin {
id = "org.democratic-csi.nfs"
type = "controller"
mount_dir = "/csi"
}
template {
data = <<TMPL
driver: nfs-client
instance_id: int-nfs-1
nfs:
shareHost: 192.168.15.25
shareBasePath: /opt/csi-volumes
controllerBasePath: /opt/csi-volumes
shareAlldirs: false
shareAllowedNetworks:
- 192.168.15.0/24
shareAllowedHosts: []
shareMaprootUser: root
shareMaprootGroup: root
server:
port: 50051
TMPL
destination = "${NOMAD_TASK_DIR}/driver-config-file.yaml"
}
resources {
cpu = 100
memory = 128
}
}
}
}