github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/demo/csi/hostpath/redis.nomad (about) 1 job "example" { 2 datacenters = ["dc1"] 3 4 group "cache" { 5 6 count = 2 7 8 volume "volume0" { 9 type = "csi" 10 source = "test-volume" 11 attachment_mode = "file-system" 12 access_mode = "single-node-reader-only" # alt: "single-node-writer" 13 read_only = true 14 per_alloc = true 15 } 16 17 network { 18 port "db" { 19 to = 6379 20 } 21 } 22 23 task "redis" { 24 driver = "docker" 25 26 config { 27 image = "redis:7" 28 ports = ["db"] 29 } 30 31 volume_mount { 32 volume = "volume0" 33 destination = "${NOMAD_ALLOC_DIR}/volume0" 34 } 35 36 resources { 37 cpu = 500 38 memory = 256 39 } 40 } 41 } 42 }