open-nomad/demo/csi/hostpath/redis.nomad
Seth Hoenig 65f7abf2f4 cli: update default redis and use nomad service discovery
Closes #12927
Closes #12958

This PR updates the version of redis used in our examples from 3.2 to 7.
The old version is very not supported anymore, and we should be setting
a good example by using a supported version.

The long-form example job is now fixed so that the service stanza uses
nomad as the service discovery provider, and so now the job runs without
a requirement of having Consul running and configured.
2022-05-17 10:24:19 -05:00

43 lines
722 B
HCL

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 {
image = "redis:7"
ports = ["db"]
}
volume_mount {
volume = "volume0"
destination = "${NOMAD_ALLOC_DIR}/volume0"
}
resources {
cpu = 500
memory = 256
}
}
}
}