2021-04-09 14:33:58 +00:00
|
|
|
job "example" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
|
|
|
|
group "cache" {
|
|
|
|
|
|
|
|
count = 2
|
|
|
|
|
|
|
|
volume "volume0" {
|
|
|
|
type = "csi"
|
|
|
|
source = "test-volume"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
access_mode = "single-node-reader-only" # alt: "single-node-writer"
|
|
|
|
read_only = true
|
|
|
|
per_alloc = true
|
|
|
|
}
|
|
|
|
|
|
|
|
network {
|
|
|
|
port "db" {
|
|
|
|
to = 6379
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task "redis" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
2022-05-17 15:24:19 +00:00
|
|
|
image = "redis:7"
|
2021-04-09 14:33:58 +00:00
|
|
|
ports = ["db"]
|
|
|
|
}
|
|
|
|
|
|
|
|
volume_mount {
|
|
|
|
volume = "volume0"
|
|
|
|
destination = "${NOMAD_ALLOC_DIR}/volume0"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 500
|
|
|
|
memory = 256
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|