Created
August 22, 2017 14:46
-
-
Save jesusvazquez/c74e51d009ae1ecbe5174a3564033757 to your computer and use it in GitHub Desktop.
Example redis.nomad template with ephemeral disk and data persistance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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