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

77 lines
1.2 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
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
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 = "busybox:1"
command = "nc"
args = ["-ll", "-p", "1234", "-e", "/bin/cat"]
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
port_map {
db = 1234
2019-01-26 05:06:50 +00:00
}
}
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
resources {
cpu = 100
memory = 100
2019-10-11 12:00:05 +00:00
2019-01-26 05:06:50 +00:00
network {
port "db" {}
2019-01-26 05:06:50 +00:00
}
}
service {
name = "consul-example"
2019-01-26 05:06:50 +00:00
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
}