diff --git a/grafana.nomad b/grafana.nomad new file mode 100644 index 0000000..83d9f00 --- /dev/null +++ b/grafana.nomad @@ -0,0 +1,38 @@ +job "grafana" { + datacenters = ["homelab"] + type = "service" + meta { + forcedeploiement = 1 + } + group "grafana" { + network { + port "http" { + to = 3000 + } + } + + service { + name = "grafana" + port = "http" + tags= [ + "traefik.enable=true", + "traefik.http.routers.grafana.entryPoints=websecure", + "traefik.http.routers.grafana.rule=Host(`grafana.ducamps.win`)", + "traefik.http.routers.grafana.tls.domains[0].sans=grafana.ducamps.win", + "traefik.http.routers.grafana.tls.certresolver=myresolver", + ] + } + + task "dashboard" { + driver = "docker" + config { + image = "grafana/grafana" + ports = ["http"] + volumes = [ + "/mnt/diskstation/nomad/grafana/config:/etc/grafana", + "/mnt/diskstation/nomad/grafana/lib:/var/lib/grafana" + ] + } + } + } +} diff --git a/prometheus.nomad b/prometheus.nomad new file mode 100644 index 0000000..adfdf8c --- /dev/null +++ b/prometheus.nomad @@ -0,0 +1,88 @@ +job "prometheus" { + datacenters = ["homelab"] + type = "service" + + group "prometheus" { + count = 1 + + network { + port "prometheus_ui" { + static = 9090 + } + } + + restart { + attempts = 2 + interval = "30m" + delay = "15s" + mode = "fail" + } + + ephemeral_disk { + size = 300 + } + + task "prometheus" { + template { + change_mode = "noop" + destination = "local/prometheus.yml" + + data = <