Skip to content

Instantly share code, notes, and snippets.

@jesusvazquez
Created August 22, 2017 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesusvazquez/c74e51d009ae1ecbe5174a3564033757 to your computer and use it in GitHub Desktop.
Save jesusvazquez/c74e51d009ae1ecbe5174a3564033757 to your computer and use it in GitHub Desktop.
Example redis.nomad template with ephemeral disk and data persistance
job "redis" {
region = "global"
datacenters = ["test"]
type = "service"
constraint {
attribute = "${node.class}"
value = "default"
}
group "redis" {
ephemeral_disk {
sticky = true
migrate = true
size = 300
}
task "redis" {
driver = "docker"
config {
image = "redis:3.2.10"
network_mode = "host"
command = "--requirepass 4UlKE2QX8XKJASD1HQ21WELKJSD3"
args = [
"--appendonly", "yes",
"--appendfilename", "appendonly.aof",
"--dir", "/local/"
]
}
service {
name = "redis"
port = "tcp"
check {
type = "tcp"
interval = "1s"
timeout = "5s"
}
}
resources {
cpu = 50
memory = 10
network {
mbits = 10
port "tcp" {
static = 6379
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment