2022-03-14 22:56:06 +00:00
|
|
|
job "redis" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "service"
|
2022-09-26 23:40:25 +00:00
|
|
|
priority = 60
|
2022-03-14 22:56:06 +00:00
|
|
|
|
|
|
|
group "cache" {
|
|
|
|
count = 1
|
|
|
|
|
|
|
|
ephemeral_disk {
|
|
|
|
migrate = true
|
|
|
|
sticky = true
|
|
|
|
size = 300
|
|
|
|
}
|
|
|
|
|
|
|
|
network {
|
|
|
|
mode = "bridge"
|
|
|
|
|
|
|
|
port "main" {
|
|
|
|
to = 6379
|
|
|
|
}
|
2023-03-02 19:07:07 +00:00
|
|
|
port "envoy_metrics" {
|
|
|
|
to = 9123
|
|
|
|
}
|
2022-03-14 22:56:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "redis"
|
2022-11-21 00:24:00 +00:00
|
|
|
provider = "nomad"
|
2022-03-14 22:56:06 +00:00
|
|
|
port = "main"
|
|
|
|
|
|
|
|
# check {
|
|
|
|
# name = "alive"
|
|
|
|
# type = "tcp"
|
|
|
|
# interval = "10s"
|
|
|
|
# timeout = "2s"
|
|
|
|
# }
|
2023-03-02 19:07:07 +00:00
|
|
|
|
|
|
|
meta {
|
|
|
|
envoy_metrics_addr = "${NOMAD_ADDR_envoy_metrics}"
|
|
|
|
}
|
2022-03-14 22:56:06 +00:00
|
|
|
}
|
|
|
|
|
2022-07-26 04:45:01 +00:00
|
|
|
task "redis" {
|
2022-03-14 22:56:06 +00:00
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "redis:6"
|
2022-09-06 18:31:15 +00:00
|
|
|
args = ["redis-server", "--save", "60", "1", "--loglevel", "warning", "--dir", "${NOMAD_ALLOC_DIR}/data"]
|
2022-03-14 22:56:06 +00:00
|
|
|
ports = ["main"]
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 100
|
2023-03-12 17:23:26 +00:00
|
|
|
memory = 128
|
|
|
|
memory_max = 512
|
2022-03-14 22:56:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|