diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-02 00:14:31 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-02 00:14:31 +0100 |
commit | 88ddfea4d5a49863e98ceb7c73a8a581bb50970e (patch) | |
tree | b5ea62a29414879e9a03cbf87680d36790e562f8 | |
parent | 2482a2f819012546d08b03e68bc1a6330b825b5b (diff) | |
download | nixcfg-88ddfea4d5a49863e98ceb7c73a8a581bb50970e.tar.gz nixcfg-88ddfea4d5a49863e98ceb7c73a8a581bb50970e.zip |
staging: run grafana from nixpkgs
-rw-r--r-- | cluster/staging/app/telemetry/deploy/telemetry.hcl | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/cluster/staging/app/telemetry/deploy/telemetry.hcl b/cluster/staging/app/telemetry/deploy/telemetry.hcl index f4f4013..da0a3c6 100644 --- a/cluster/staging/app/telemetry/deploy/telemetry.hcl +++ b/cluster/staging/app/telemetry/deploy/telemetry.hcl @@ -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 { |