2023-01-04 08:35:40 +00:00
|
|
|
job "telemetry-storage" {
|
|
|
|
datacenters = ["neptune", "bespin"]
|
|
|
|
type = "service"
|
|
|
|
|
|
|
|
group "prometheus" {
|
|
|
|
count = 2
|
|
|
|
|
|
|
|
network {
|
|
|
|
port "prometheus" {
|
|
|
|
static = 9090
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
constraint {
|
|
|
|
attribute = "${attr.unique.hostname}"
|
|
|
|
operator = "set_contains_any"
|
2023-03-13 18:58:37 +00:00
|
|
|
value = "celeri,df-ymk"
|
2023-01-04 08:35:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
task "prometheus" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
2023-08-06 11:45:46 +00:00
|
|
|
image = "prom/prometheus:v2.46.0"
|
2023-01-04 08:35:40 +00:00
|
|
|
network_mode = "host"
|
|
|
|
ports = [ "prometheus" ]
|
|
|
|
args = [
|
|
|
|
"--config.file=/etc/prometheus/prometheus.yml",
|
|
|
|
"--storage.tsdb.path=/data",
|
|
|
|
"--storage.tsdb.retention.size=20GB",
|
|
|
|
]
|
|
|
|
volumes = [
|
|
|
|
"secrets:/etc/prometheus",
|
|
|
|
"/mnt/ssd/prometheus:/data"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = file("../config/prometheus.yml")
|
|
|
|
destination = "secrets/prometheus.yml"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-ca.crt\" }}"
|
|
|
|
destination = "secrets/consul-ca.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.crt\" }}"
|
|
|
|
destination = "secrets/consul-client.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.key\" }}"
|
|
|
|
destination = "secrets/consul-client.key"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/nomad/nomad-ca.crt\" }}"
|
|
|
|
destination = "secrets/nomad-ca.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/nomad/nomad-client.crt\" }}"
|
|
|
|
destination = "secrets/nomad-client.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/nomad/nomad-client.key\" }}"
|
|
|
|
destination = "secrets/nomad-client.key"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
2024-03-08 11:03:48 +00:00
|
|
|
memory = 1500
|
|
|
|
memory_max = 4000
|
2023-01-04 08:35:40 +00:00
|
|
|
cpu = 1000
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
port = 9090
|
|
|
|
address_mode = "driver"
|
|
|
|
name = "prometheus"
|
|
|
|
check {
|
|
|
|
type = "http"
|
|
|
|
path = "/"
|
|
|
|
port = 9090
|
|
|
|
address_mode = "driver"
|
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|