orchestration-tests/nomad/storage_plugins/democratic-nfs.nomad

68 lines
1.5 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"
}
job "democratic-csi-nfs" {
datacenters = ["dc1"]
# you can run node plugins as service jobs as well, but this ensures
# that all nodes in the DC have a copy.
type = "system"
group "monolith" {
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=node",
"--csi-mode=controller",
"--server-socket=/csi/csi.sock",
]
}
template {
destination = "${NOMAD_TASK_DIR}/driver-config-file.yaml"
data = <<EOH
driver: nfs-client
instance_id: ${attr.unique.hostname}
nfs:
shareHost: 192.168.2.10
shareBasePath: "/Containers/nomad-csi"
# shareHost:shareBasePath should be mounted at this location in the controller container
controllerBasePath: "/storage"
dirPermissionsMode: "0777"
# dirPermissionsUser: root
# dirPermissionsGroup: wheel
EOH
}
csi_plugin {
# must match --csi-name arg
id = "org.democratic-csi.nfs"
type = "monolith"
mount_dir = "/csi"
}
resources {
cpu = 500
memory = 256
}
}
}
}