chore: backup infrastructure configurations [skip ci]
This commit is contained in:
@@ -2,7 +2,9 @@ job "grafana" {
|
||||
# region = "global"
|
||||
datacenters = ["dc1"]
|
||||
type = "service"
|
||||
|
||||
# priority = 50
|
||||
|
||||
constraint {
|
||||
attribute = "${attr.kernel.name}"
|
||||
value = "linux"
|
||||
@@ -19,23 +21,29 @@ job "grafana" {
|
||||
}
|
||||
group "grafana" {
|
||||
count = 1
|
||||
|
||||
restart {
|
||||
attempts = 2
|
||||
interval = "1m"
|
||||
delay = "10s"
|
||||
mode = "delay"
|
||||
}
|
||||
|
||||
task "grafana" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
// image = "fg2it/grafana-armhf:v5.1.4"
|
||||
image = "grafana/grafana:latest"
|
||||
ports = ["http"]
|
||||
|
||||
logging {
|
||||
type = "json-file"
|
||||
}
|
||||
|
||||
memory_hard_limit = 2048
|
||||
}
|
||||
|
||||
env {
|
||||
disable_login_form = "EST5EDT"
|
||||
PUID = 1000
|
||||
@@ -45,28 +53,25 @@ job "grafana" {
|
||||
GF_AUTH_ANONYMOUS_ORG_NAME = "Main Org."
|
||||
GF_AUTH_ANONYMOUS_ORG_ROLE = "Admin"
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOH
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
url: http://prometheus.service.dc1.consul:9090
|
||||
isDefault: true
|
||||
- name: Loki
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://{{ range service "loki" }}{{ .Address }}:{{ .Port }}{{ end }}
|
||||
isDefault: false
|
||||
editable: true
|
||||
jsonData:
|
||||
maxLines: 1000
|
||||
isDefault:
|
||||
EOH
|
||||
|
||||
destination = "local/datasources/prometheus.yaml"
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOH
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
- name: dashboards
|
||||
type: file
|
||||
@@ -75,24 +80,28 @@ providers:
|
||||
path: /local/dashboard_definitons
|
||||
foldersFromFilesStructure: true
|
||||
EOH
|
||||
|
||||
destination = "local/dashboards/dashboards.yaml"
|
||||
}
|
||||
|
||||
template {
|
||||
data = "{{ key \"grafana_dashboards/nomad\" }}"
|
||||
destination = "local/dashboard_definitons/nomad.json"
|
||||
}
|
||||
template {
|
||||
template {
|
||||
data = "{{ key \"grafana_dashboards/thermals\" }}"
|
||||
destination = "local/dashboard_definitons/thermals.json"
|
||||
}
|
||||
template {
|
||||
template {
|
||||
data = "{{ key \"grafana_dashboards/NomadMem\" }}"
|
||||
destination = "local/dashboard_definitons/NomadMem.json"
|
||||
}
|
||||
|
||||
service {
|
||||
name = "${TASKGROUP}"
|
||||
tags = ["global", "backend"]
|
||||
port = "http"
|
||||
|
||||
check {
|
||||
name = "alive"
|
||||
type = "http"
|
||||
@@ -100,6 +109,7 @@ providers:
|
||||
timeout = "120s"
|
||||
path = "/login"
|
||||
port = "http"
|
||||
|
||||
check_restart {
|
||||
limit = 3
|
||||
grace = "120s"
|
||||
@@ -107,17 +117,21 @@ providers:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 128 # 500 MHz
|
||||
memory = 64 # 128MB
|
||||
}
|
||||
|
||||
# Specify configuration related to log rotation
|
||||
logs {
|
||||
max_files = 10
|
||||
max_file_size = 15
|
||||
}
|
||||
|
||||
kill_timeout = "10s"
|
||||
}
|
||||
|
||||
network {
|
||||
port "http" {
|
||||
static = 3100
|
||||
|
||||
Reference in New Issue
Block a user