forked from discoposse/nomad-vagrant-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.nomad
63 lines (56 loc) · 1.07 KB
/
test.nomad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
job "fail" {
datacenters = ["toronto"]
constraint {
attribute = "${attr.unique.consul.name}"
operator = "regexp"
value = "^(nomad-a-3)$"
}
update {
healthy_deadline = "30s"
progress_deadline = "40s"
min_healthy_time = "0s"
}
meta {
redeploy = 1
}
group "fail-failed" {
count = "1"
network {
port "http" {
to = 8080
}
}
service {
port = "http"
check {
port = "http"
type = "http"
path = "/health"
method = "GET"
interval = "10s"
timeout = "2s"
check_restart {
limit = 2
}
}
}
task "fail" {
driver = "docker"
config {
# here https://medium.com/@obenaus.thomas/a-good-default-nomad-job-template-ea448b8a8cdd
image = "thobe/fail_service:latest"
ports = ["http"]
}
resources {
cores = 1
}
env {
# unhealhy config
HEALTHY_FOR = 60
UNHEALTHY_FOR = -1
# healthy config
# HEALTHY_FOR = -1
}
}
}
}