mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-30 12:06:13 +01:00
60 lines
1.2 KiB
HCL
60 lines
1.2 KiB
HCL
|
variable "datacenters" {
|
||
|
type = list(string)
|
||
|
}
|
||
|
|
||
|
job "democratic-csi-nfs-node" {
|
||
|
datacenters = var.datacenters
|
||
|
|
||
|
type = "system"
|
||
|
|
||
|
group "nodes" {
|
||
|
task "plugin" {
|
||
|
driver = "docker"
|
||
|
|
||
|
env {
|
||
|
CSI_NODE_ID = "${attr.unique.hostname}"
|
||
|
}
|
||
|
|
||
|
config {
|
||
|
image = "docker.io/democraticcsi/democratic-csi:latest"
|
||
|
|
||
|
args = [
|
||
|
"--csi-version=1.5.0",
|
||
|
# must match the csi_plugin.id attribute below
|
||
|
"--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/csi.sock",
|
||
|
]
|
||
|
|
||
|
# node plugins must run as privileged jobs because they
|
||
|
# mount disks to the host
|
||
|
privileged = true
|
||
|
ipc_mode = "host"
|
||
|
network_mode = "host"
|
||
|
}
|
||
|
|
||
|
template {
|
||
|
destination = "${NOMAD_TASK_DIR}/driver-config-file.yaml"
|
||
|
|
||
|
data = <<EOH
|
||
|
driver: node-manual
|
||
|
EOH
|
||
|
}
|
||
|
|
||
|
csi_plugin {
|
||
|
# must match --csi-name arg
|
||
|
id = "org.democratic-csi.nfs"
|
||
|
type = "node"
|
||
|
mount_dir = "/csi"
|
||
|
}
|
||
|
|
||
|
resources {
|
||
|
cpu = 500
|
||
|
memory = 256
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|