-
Notifications
You must be signed in to change notification settings - Fork 1
/
consul-esm.nomad
127 lines (117 loc) · 2.53 KB
/
consul-esm.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
variable "consul_esm_version" {
type = string
default = "0.7.1"
}
job "consul-esm" {
group "main" {
network {
port "metrics" {
to = "9000"
}
}
count = 5
update {
max_parallel = 1
health_check = "checks"
min_healthy_time = "20s"
healthy_deadline = "5m"
auto_revert = true
auto_promote = true
canary = 1
}
migrate {
max_parallel = 1
health_check = "checks"
min_healthy_time = "10s"
healthy_deadline = "5m"
}
restart {
interval = "10m"
attempts = 3
delay = "1m"
mode = "delay"
}
reschedule {
unlimited = true
delay = "15s"
delay_function = "fibonacci"
max_delay = "1h"
}
task "monitor" {
env {
log_level = "INFO"
}
// scaling {
// enabled = true
// min = 0
// max = 3
// policy {
// }
// }
service {
port = "metrics"
check {
name = "metrics_health"
type = "http"
path = "/metrics"
interval = "1m"
timeout = "5s"
}
}
driver = "exec"
config {
command = "local/consul-esm"
args = [
"-config-dir=local"
]
}
template {
data = <<EOT
log_level = "{{ env "log_level" }}"
enable_syslog = false
log_json = false
instance_id = "${uuidv4()}"
consul_service = "consul-esm"
consul_service_tag = ""
consul_kv_path = "consul-esm/"
external_node_meta {
"external-node" = "true"
}
node_reconnect_timeout = "72h"
node_reconnect_timeout = "72h"
node_probe_interval = "10s"
disable_coordinate_updates = false
http_addr = "localhost:8500"
token = ""
datacenter = "dc1"
client_address = "{{ env "NOMAD_ADDR_metrics" }}"
ping_type = "udp"
telemetry {
disable_hostname = false
filter_default = false
prefix_filter = []
metrics_prefix = "/metrics"
prometheus_retention_time = "30s"
}
passing_threshold = 0
critical_threshold = 0
EOT
destination = "local/config.hcl"
perms = "0644"
}
artifact {
source = "https://releases.hashicorp.com/consul-esm/${var.consul_esm_version}/consul-esm_${var.consul_esm_version}_linux_arm64.zip"
destination = "local/consul-esm"
mode = "file"
}
identity {
env = true
file = true
}
resources {
cpu = 50
memory = 25
}
}
}
}