github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/e2e/csi/input/use-ebs-volume.nomad (about) 1 # a job that mounts an EBS volume and writes its job ID as a file 2 job "use-ebs-volume" { 3 datacenters = ["dc1", "dc2"] 4 5 constraint { 6 attribute = "${attr.kernel.name}" 7 value = "linux" 8 } 9 10 group "group" { 11 volume "test" { 12 type = "csi" 13 source = "ebs-vol0" 14 } 15 16 task "task" { 17 driver = "docker" 18 19 config { 20 image = "busybox:1" 21 command = "/bin/sh" 22 args = ["-c", "echo 'ok' > ${NOMAD_TASK_DIR}/test/${NOMAD_ALLOC_ID}; sleep 3600"] 23 } 24 25 volume_mount { 26 volume = "test" 27 destination = "${NOMAD_TASK_DIR}/test" 28 read_only = false 29 } 30 31 resources { 32 cpu = 500 33 memory = 128 34 } 35 } 36 } 37 }