homelab/nomad-job/loki.nomad

103 lines
2.0 KiB
Plaintext
Raw Normal View History

2022-05-13 18:17:20 +00:00
job "loki" {
datacenters = ["homelab"]
2022-12-10 16:10:32 +00:00
priority = 50
2022-10-29 08:40:01 +00:00
type = "service"
2022-05-13 18:17:20 +00:00
meta {
forcedeploy = "0"
}
2024-02-21 18:03:31 +00:00
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
2022-10-29 08:40:01 +00:00
group "loki" {
2022-05-13 18:17:20 +00:00
network {
mode = "host"
port "http" {
static = 3100
}
}
task "loki" {
driver = "docker"
service {
name = "loki"
port = "http"
check {
name = "Loki HTTP"
type = "http"
path = "/ready"
interval = "5s"
timeout = "2s"
check_restart {
limit = 2
grace = "60s"
ignore_warnings = false
}
}
}
config {
2024-03-17 17:58:24 +00:00
image = "docker.service.consul:5000/grafana/loki"
2022-05-13 18:17:20 +00:00
ports = ["http"]
args = [
"-config.file",
"/etc/loki/local-config.yaml",
]
2022-05-14 07:33:15 +00:00
volumes = [
"/mnt/diskstation/nomad/loki:/loki"
]
2022-05-13 18:17:20 +00:00
}
template {
2022-10-29 08:40:01 +00:00
data = <<EOH
2022-05-13 18:17:20 +00:00
auth_enabled: false
server:
http_listen_port: 3100
2024-04-09 06:39:37 +00:00
common:
instance_addr: 127.0.0.1
path_prefix: /loki
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
2022-05-13 18:17:20 +00:00
schema_config:
configs:
2024-04-09 06:39:37 +00:00
- from: "2023-04-08" # <---- A date in the future
2022-05-13 18:17:20 +00:00
index:
period: 24h
2024-04-09 06:39:37 +00:00
prefix: index_
object_store: filesystem
schema: v13
store: tsdb
2022-05-13 18:17:20 +00:00
compactor:
2024-04-09 06:39:37 +00:00
retention_enabled: true
working_directory: /loki/tsdb-shipper-compactor
2022-05-13 18:17:20 +00:00
shared_store: filesystem
limits_config:
2024-04-09 06:39:37 +00:00
retention_period: 90d
2022-05-13 18:17:20 +00:00
reject_old_samples: true
reject_old_samples_max_age: 168h
2024-04-09 06:39:37 +00:00
query_range:
results_cache:
cache:
embedded_cache:
enabled: true
max_size_mb: 100
2022-05-13 18:17:20 +00:00
EOH
destination = "local/loki/local-config.yaml"
}
resources {
2023-10-08 12:52:33 +00:00
memory = 300
2024-04-09 06:39:37 +00:00
memory_max = 1000
2022-05-13 18:17:20 +00:00
}
}
}
}