homelab-nomad/storage_plugins/democratic-csi-nfs-controller.nomad

56 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2022-06-17 22:19:19 +00:00
variable "image_name" {
type = string
default = "docker.io/democraticcsi/democratic-csi:latest"
}
variable "csi_version" {
type = string
default = "1.5.0"
}
variable "config_data" {
type = string
}
job "democratic-csi-nfs-controller" {
datacenters = ["dc1"]
group "controller" {
task "plugin" {
driver = "docker"
config {
image = var.image_name
args = [
"--csi-version=${var.csi_version}",
# 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=controller",
"--server-socket=/csi/csi.sock",
]
}
template {
destination = "${NOMAD_TASK_DIR}/driver-config-file.yaml"
data = var.config_data
}
csi_plugin {
# must match --csi-name arg
id = "org.democratic-csi.nfs"
type = "controller"
mount_dir = "/csi"
}
resources {
cpu = 250
memory = 128
}
}
}
}