2020-03-16 12:53:04 +00:00
|
|
|
# a job that mounts the EFS volume and sleeps, so that we can
|
|
|
|
# read its mounted file system remotely
|
|
|
|
job "use-efs-volume" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
|
2020-04-06 15:57:59 +00:00
|
|
|
constraint {
|
|
|
|
attribute = "${attr.kernel.name}"
|
|
|
|
value = "linux"
|
|
|
|
}
|
|
|
|
|
2020-03-16 12:53:04 +00:00
|
|
|
group "group" {
|
2021-04-07 17:42:26 +00:00
|
|
|
|
2020-03-16 12:53:04 +00:00
|
|
|
volume "test" {
|
2021-04-07 17:42:26 +00:00
|
|
|
type = "csi"
|
|
|
|
source = "efs-vol0"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
access_mode = "single-node-writer"
|
2020-03-16 12:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
task "task" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "busybox:1"
|
|
|
|
command = "/bin/sh"
|
|
|
|
args = ["-c", "sleep 3600"]
|
|
|
|
}
|
|
|
|
|
|
|
|
volume_mount {
|
|
|
|
volume = "test"
|
|
|
|
destination = "${NOMAD_TASK_DIR}/test"
|
|
|
|
read_only = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 500
|
|
|
|
memory = 128
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|