github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/demo/csi/kadalu-csi/app.nomad (about) 1 variable "cn_network" { 2 default = "dc1" 3 } 4 5 variable "vol-id" { 6 default = "csi-test" 7 } 8 9 job "sample-pv-check" { 10 datacenters = ["${var.cn_network}"] 11 12 group "apps" { 13 volume "test" { 14 type = "csi" 15 source = "${var.vol-id}" 16 access_mode = "multi-node-multi-writer" 17 attachment_mode = "file-system" 18 } 19 20 task "sample" { 21 # To verify volume is mounted correctly and accessible, please run 22 # 'nomad alloc exec <alloc_id> bash /kadalu/script.sh' 23 # after this job is scheduled and running on a nomad client 24 driver = "docker" 25 26 config { 27 image = "kadalu/sample-pv-check-app:latest" 28 force_pull = false 29 30 entrypoint = [ 31 "tail", 32 "-f", 33 "/dev/null", 34 ] 35 } 36 37 volume_mount { 38 volume = "test" 39 40 # Script in this image looks for PV mounted at '/mnt/pv' 41 destination = "/mnt/pv" 42 } 43 } 44 } 45 }