-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-nomad-job.hcl
82 lines (62 loc) · 1.34 KB
/
example-nomad-job.hcl
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
variable "image_id" {
type = string
description = "The docker image used for task."
default = "philipcristiano/nomad-events-logger:0.1.3"
}
variable "count" {
type = number
description = "Number of instances"
default = 1
}
job "nomad-events-logger" {
datacenters = ["dc1"]
type = "service"
group "app" {
count = var.count
update {
max_parallel = 1
min_healthy_time = "30s"
healthy_deadline = "5m"
}
restart {
attempts = 2
interval = "1m"
delay = "10s"
mode = "delay"
}
service {
name = "nomad-events-logger"
check {
name = "version"
type = "script"
task = "app"
command = "/usr/local/bin/nomad_events_logger"
args = ["-V"]
interval = "30s"
timeout = "2s"
}
}
task "app" {
driver = "docker"
vault {
policies = ["service-nomad-events-logger"]
}
config {
image = var.image_id
command = "nomad_events_logger"
}
template {
destination = "local/app.env"
env = true
data = <<EOF
NOMAD_BASE_URL="http://nomad.{{ key "site/domain"}}"
EOF
}
resources {
cpu = 10
memory = 16
memory_max = 64
}
}
}
}