-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloki.nomad
102 lines (93 loc) · 2.08 KB
/
loki.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
variable "loki_version" {
type = string
default = "v2.7.5"
}
job "loki" {
datacenters = ["dc1"]
type = "service"
name = "loki"
priority = 80
meta {
auto-backup = true
backup-schedule = "@hourly"
backup-target-db = "postgres"
}
update {
max_parallel = 2
health_check = "checks"
min_healthy_time = "5s"
healthy_deadline = "300s"
progress_deadline = "10m"
auto_revert = true
auto_promote = true
canary = 1
}
reschedule {
interval = "30m"
delay = "30s"
delay_function = "exponential"
max_delay = "1200s"
unlimited = true
}
migrate {
max_parallel = 2
health_check = "checks"
min_healthy_time = "10s"
healthy_deadline = "5m"
}
group "log-server" {
count = 1
network {
port "http" {}
port "grpc" {}
}
service {
name = "loki-http-server"
tags = ["urlprefix-/loki strip=/loki"]
port = "http"
on_update = "require_healthy"
check {
name = "loki_ready"
type = "http"
path = "/ready"
port = "http"
interval = "10s"
timeout = "3s"
}
}
service {
name = "loki-grpc"
port = "grpc"
}
task "server" {
driver = "exec"
vault {
// policies = ["read-only"]
change_mode = "signal"
change_signal = "SIGHUP"
}
config {
command = "loki"
args = [
"-config.file=local/loki.yml"
]
}
resources {
cpu = 1000
memory = 200
}
template {
data = file("loki.yml.tpl")
destination = "local/loki.yml"
change_mode = "restart"
}
artifact {
source = "https://github.com/grafana/loki/releases/download/${var.loki_version}/loki-linux-${attr.cpu.arch}.zip"
options { # checksum depends on the cpu arch
}
destination = "local/loki"
mode = "file"
}
}
}
}