forked from Deuxfleurs/nixcfg
staging: run grafana from nixpkgs
This commit is contained in:
parent
2482a2f819
commit
88ddfea4d5
1 changed files with 29 additions and 29 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue