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
This commit is contained in:
69
csi/node.nomad
Normal file
69
csi/node.nomad
Normal file
@@ -0,0 +1,69 @@
|
||||
job "csi-nfs-node" {
|
||||
datacenters = ["dc1"]
|
||||
type = "service"
|
||||
namespace = "default"
|
||||
|
||||
# Only int for now — expand to all workers once verified
|
||||
constraint {
|
||||
attribute = "${node.unique.name}"
|
||||
value = "int"
|
||||
}
|
||||
|
||||
group "node" {
|
||||
count = 1
|
||||
|
||||
task "plugin" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "democraticcsi/democratic-csi:latest"
|
||||
command = "/bin/democratic-csi"
|
||||
network_mode = "host"
|
||||
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=node",
|
||||
"--server-socket=${CSI_ENDPOINT}",
|
||||
]
|
||||
|
||||
privileged = true
|
||||
}
|
||||
|
||||
csi_plugin {
|
||||
id = "org.democratic-csi.nfs"
|
||||
type = "node"
|
||||
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
|
||||
mountOptions:
|
||||
- nolock
|
||||
- nfsvers=4
|
||||
server:
|
||||
port: 50051
|
||||
TMPL
|
||||
destination = "${NOMAD_TASK_DIR}/driver-config-file.yaml"
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 100
|
||||
memory = 128
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user