open-nomad/e2e/consul/input/consul_example.nomad

71 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-01-26 05:06:50 +00:00
job "consul-example" {
datacenters = ["dc1"]
2019-10-11 12:00:05 +00:00
type = "service"
2019-01-26 05:06:50 +00:00
update {
2019-10-11 12:00:05 +00:00
max_parallel = 1
min_healthy_time = "10s"
healthy_deadline = "3m"
2019-01-26 05:06:50 +00:00
progress_deadline = "10m"
2019-10-11 12:00:05 +00:00
auto_revert = false
canary = 0
2019-01-26 05:06:50 +00:00
}
migrate {
2019-10-11 12:00:05 +00:00
max_parallel = 1
health_check = "checks"
2019-01-26 05:06:50 +00:00
min_healthy_time = "10s"
healthy_deadline = "5m"
}
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
group "cache" {
count = 3
restart {
attempts = 2
interval = "30m"
2019-10-11 12:00:05 +00:00
delay = "15s"
mode = "fail"
2019-01-26 05:06:50 +00:00
}
ephemeral_disk {
size = 300
}
task "redis" {
driver = "docker"
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
config {
image = "redis:3.2"
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
port_map {
db = 6379
}
}
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
resources {
cpu = 500 # 500 MHz
memory = 256 # 256MB
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
network {
mbits = 10
2019-11-19 15:36:41 +00:00
port "db" {}
2019-01-26 05:06:50 +00:00
}
}
service {
name = "redis-cache"
tags = ["global", "cache"]
port = "db"
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
check {
name = "alive"
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
}
}
2019-10-11 12:00:05 +00:00
}