2022-02-17 14:06:09 +00:00
|
|
|
job "telemetry" {
|
|
|
|
datacenters = ["neptune"]
|
|
|
|
type = "service"
|
|
|
|
|
2022-02-26 19:31:57 +00:00
|
|
|
group "kibana" {
|
|
|
|
count = 1
|
2022-02-17 14:06:09 +00:00
|
|
|
|
|
|
|
network {
|
|
|
|
port "kibana" {
|
|
|
|
static = 5601
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task "kibana" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
2022-05-04 14:27:46 +00:00
|
|
|
image = "docker.elastic.co/kibana/kibana:8.2.0"
|
2022-02-17 14:06:09 +00:00
|
|
|
network_mode = "host"
|
|
|
|
ports = [ "kibana" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
2022-02-27 13:06:17 +00:00
|
|
|
SERVER_NAME={{ env "attr.unique.hostname" }}
|
2022-02-17 14:06:09 +00:00
|
|
|
ELASTICSEARCH_HOSTS=http://localhost:9200
|
2022-02-26 17:56:16 +00:00
|
|
|
ELASTICSEARCH_USERNAME=kibana_system
|
|
|
|
ELASTICSEARCH_PASSWORD={{ key "secrets/telemetry/elastic_passwords/kibana_system" }}
|
2022-02-27 13:06:17 +00:00
|
|
|
SERVER_PUBLICBASEURL=https://kibana.home.adnab.me
|
2022-02-17 14:06:09 +00:00
|
|
|
EOH
|
|
|
|
destination = "secrets/env"
|
|
|
|
env = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
2022-02-26 20:31:58 +00:00
|
|
|
memory = 1000
|
2022-02-17 14:06:09 +00:00
|
|
|
cpu = 500
|
|
|
|
}
|
|
|
|
|
2022-02-26 19:31:57 +00:00
|
|
|
service {
|
|
|
|
tags = [
|
|
|
|
"kibana",
|
2022-06-01 12:25:45 +00:00
|
|
|
"tricot kibana.staging.deuxfleurs.org",
|
2022-02-17 14:06:09 +00:00
|
|
|
]
|
2022-02-26 19:31:57 +00:00
|
|
|
port = 5601
|
|
|
|
address_mode = "driver"
|
|
|
|
name = "kibana"
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
|
|
|
port = 5601
|
|
|
|
address_mode = "driver"
|
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
2022-02-17 14:06:09 +00:00
|
|
|
}
|
2022-02-26 19:31:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
group "grafana" {
|
|
|
|
count = 1
|
2022-02-17 14:06:09 +00:00
|
|
|
|
2022-02-26 19:31:57 +00:00
|
|
|
network {
|
|
|
|
port "grafana" {
|
|
|
|
static = 3333
|
2022-02-17 14:06:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-26 20:31:58 +00:00
|
|
|
task "restore-db" {
|
|
|
|
lifecycle {
|
|
|
|
hook = "prestart"
|
|
|
|
sidecar = false
|
|
|
|
}
|
|
|
|
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
|
|
|
image = "litestream/litestream:0.3.7"
|
|
|
|
args = [
|
|
|
|
"restore", "-config", "/etc/litestream.yml", "/ephemeral/grafana.db"
|
|
|
|
]
|
|
|
|
volumes = [
|
|
|
|
"../alloc/data:/ephemeral",
|
|
|
|
"secrets/litestream.yml:/etc/litestream.yml"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
user = "472"
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = file("../config/grafana-litestream.yml")
|
|
|
|
destination = "secrets/litestream.yml"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
memory = 200
|
|
|
|
cpu = 1000
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-17 14:06:09 +00:00
|
|
|
task "grafana" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
2022-03-07 15:57:43 +00:00
|
|
|
image = "grafana/grafana:8.4.3"
|
2022-02-17 14:06:09 +00:00
|
|
|
network_mode = "host"
|
|
|
|
ports = [ "grafana" ]
|
|
|
|
volumes = [
|
2022-02-26 20:31:58 +00:00
|
|
|
"../alloc/data:/var/lib/grafana",
|
2022-02-17 14:06:09 +00:00
|
|
|
"secrets/elastic.yaml:/etc/grafana/provisioning/datasources/elastic.yaml"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = file("../config/grafana/provisioning/datasources/elastic.yaml")
|
|
|
|
destination = "secrets/elastic.yaml"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,grafana-piechart-panel,grafana-worldmap-panel,grafana-polystat-panel
|
|
|
|
GF_SERVER_HTTP_PORT=3333
|
|
|
|
EOH
|
|
|
|
destination = "secrets/env"
|
|
|
|
env = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
memory = 500
|
|
|
|
cpu = 100
|
|
|
|
}
|
2022-02-26 20:31:58 +00:00
|
|
|
|
|
|
|
service {
|
|
|
|
tags = [
|
|
|
|
"grafana",
|
2022-06-01 12:25:45 +00:00
|
|
|
"tricot grafana.staging.deuxfleurs.org",
|
2022-02-26 20:31:58 +00:00
|
|
|
]
|
|
|
|
port = 3333
|
|
|
|
address_mode = "driver"
|
|
|
|
name = "grafana"
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
|
|
|
port = 3333
|
|
|
|
address_mode = "driver"
|
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-17 14:06:09 +00:00
|
|
|
}
|
|
|
|
|
2022-02-26 20:31:58 +00:00
|
|
|
task "replicate-db" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
|
|
|
image = "litestream/litestream:0.3.7"
|
|
|
|
args = [
|
|
|
|
"replicate", "-config", "/etc/litestream.yml"
|
|
|
|
]
|
|
|
|
volumes = [
|
|
|
|
"../alloc/data:/ephemeral",
|
|
|
|
"secrets/litestream.yml:/etc/litestream.yml"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
user = "472"
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = file("../config/grafana-litestream.yml")
|
|
|
|
destination = "secrets/litestream.yml"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
memory = 200
|
|
|
|
cpu = 100
|
|
|
|
}
|
|
|
|
}
|
2022-02-17 14:06:09 +00:00
|
|
|
}
|
|
|
|
}
|