Files
nomad-csi/csi/controller.nomad

90 lines
2.2 KiB
Plaintext
Raw Normal View History

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
# Pinned to int, so an int reboot takes the controller down with it.
# Without these the allocation is marked Lost and never returns.
restart {
attempts = 5
interval = "10m"
delay = "30s"
mode = "delay"
}
reschedule {
unlimited = true
delay = "30s"
delay_function = "exponential"
max_delay = "5m"
}
task "plugin" {
driver = "docker"
config {
# Pinned by digest rather than :latest — see node.nomad for why.
image = "democraticcsi/democratic-csi@sha256:944d0e65077efbd9c1fdf23997eec8fac4b4bfb7c3de400f63e33a0a849c5ced"
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"
}
# The controller does the provisioning work (volume create, NFS export
# management), so it gets more headroom than the node plugin.
resources {
cpu = 100
memory = 256
memory_max = 768
}
}
}
}