staging: run grafana from nixpkgs

This commit is contained in:
Alex 2022-12-02 00:14:31 +01:00
parent 2482a2f819
commit 88ddfea4d5
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE

View file

@ -91,22 +91,21 @@ job "telemetry" {
sidecar = false
}
driver = "docker"
driver = "nix2"
config {
image = "litestream/litestream:0.3.7"
packages = [ "#litestream" ]
command = "litestream"
args = [
"restore", "-config", "/etc/litestream.yml", "/ephemeral/grafana.db"
]
volumes = [
"../alloc/data:/ephemeral",
"secrets/litestream.yml:/etc/litestream.yml"
]
bind = {
"../alloc/data" = "/ephemeral",
}
}
user = "472"
template {
data = file("../config/grafana-litestream.yml")
destination = "secrets/litestream.yml"
destination = "etc/litestream.yml"
}
resources {
@ -117,20 +116,25 @@ job "telemetry" {
}
task "grafana" {
driver = "docker"
driver = "nix2"
config {
image = "grafana/grafana:9.2.3"
network_mode = "host"
ports = [ "grafana" ]
volumes = [
"../alloc/data:/var/lib/grafana",
"secrets/prometheus.yaml:/etc/grafana/provisioning/datasources/prometheus.yaml"
nixpkgs = "github:nixos/nixpkgs/nixos-22.11"
packages = [ "#grafana" ]
command = "grafana-server"
args = [
"-homepath", "/share/grafana",
"cfg:default.paths.data=/grafana",
"cfg:default.paths.provisioning=/grafana-provisioning"
]
bind = {
"../alloc/data" = "/grafana",
}
}
template {
data = file("../config/grafana-datasource-prometheus.yaml")
destination = "secrets/prometheus.yaml"
destination = "grafana-provisioning/datasources/prometheus.yaml"
}
template {
@ -148,17 +152,14 @@ job "telemetry" {
}
service {
name = "grafana"
tags = [
"grafana",
"tricot grafana.staging.deuxfleurs.org",
]
port = 3719
address_mode = "driver"
name = "grafana"
port = "grafana"
check {
type = "tcp"
port = 3719
address_mode = "driver"
interval = "60s"
timeout = "5s"
check_restart {
@ -171,22 +172,21 @@ job "telemetry" {
}
task "replicate-db" {
driver = "docker"
driver = "nix2"
config {
image = "litestream/litestream:0.3.7"
packages = [ "#litestream" ]
command = "litestream"
args = [
"replicate", "-config", "/etc/litestream.yml"
]
volumes = [
"../alloc/data:/ephemeral",
"secrets/litestream.yml:/etc/litestream.yml"
]
bind = {
"../alloc/data" = "/ephemeral",
}
}
user = "472"
template {
data = file("../config/grafana-litestream.yml")
destination = "secrets/litestream.yml"
destination = "etc/litestream.yml"
}
resources {