diff options
Diffstat (limited to 'cluster/prod/app/telemetry')
-rw-r--r-- | cluster/prod/app/telemetry/deploy/telemetry-service.hcl | 98 | ||||
-rw-r--r-- | cluster/prod/app/telemetry/deploy/telemetry-storage.hcl | 97 |
2 files changed, 100 insertions, 95 deletions
diff --git a/cluster/prod/app/telemetry/deploy/telemetry-service.hcl b/cluster/prod/app/telemetry/deploy/telemetry-service.hcl index 4790cbd..9955872 100644 --- a/cluster/prod/app/telemetry/deploy/telemetry-service.hcl +++ b/cluster/prod/app/telemetry/deploy/telemetry-service.hcl @@ -1,100 +1,7 @@ job "telemetry-service" { - datacenters = ["neptune", "bespin"] + datacenters = ["neptune", "orion"] type = "service" - group "prometheus" { - count = 2 - - network { - port "prometheus" { - static = 9090 - } - } - - constraint { - attribute = "${attr.unique.hostname}" - operator = "set_contains_any" - value = "concombre,df-ymk" - } - - task "prometheus" { - driver = "docker" - config { - image = "prom/prometheus:v2.39.0" - network_mode = "host" - ports = [ "prometheus" ] - args = [ - "--config.file=/etc/prometheus/prometheus.yml", - "--storage.tsdb.path=/data", - "--storage.tsdb.retention.size=20GB", - ] - volumes = [ - "secrets:/etc/prometheus", - "/mnt/ssd/prometheus:/data" - ] - } - - template { - data = file("../config/prometheus.yml") - destination = "secrets/prometheus.yml" - } - - template { - data = "{{ key \"secrets/consul/consul-ca.crt\" }}" - destination = "secrets/consul-ca.crt" - } - - template { - data = "{{ key \"secrets/consul/consul-client.crt\" }}" - destination = "secrets/consul-client.crt" - } - - template { - data = "{{ key \"secrets/consul/consul-client.key\" }}" - destination = "secrets/consul-client.key" - } - - template { - data = "{{ key \"secrets/nomad/nomad-ca.crt\" }}" - destination = "secrets/nomad-ca.crt" - } - - template { - data = "{{ key \"secrets/nomad/nomad-client.crt\" }}" - destination = "secrets/nomad-client.crt" - } - - template { - data = "{{ key \"secrets/nomad/nomad-client.key\" }}" - destination = "secrets/nomad-client.key" - } - - resources { - memory = 1000 - cpu = 1000 - } - - service { - port = 9090 - address_mode = "driver" - name = "prometheus" - check { - type = "http" - path = "/" - port = 9090 - address_mode = "driver" - interval = "60s" - timeout = "5s" - check_restart { - limit = 3 - grace = "90s" - ignore_warnings = false - } - } - } - } - } - group "grafana" { count = 1 @@ -137,7 +44,7 @@ job "telemetry-service" { task "grafana" { driver = "docker" config { - image = "grafana/grafana:9.2.0" + image = "grafana/grafana:9.3.2" network_mode = "host" ports = [ "grafana" ] volumes = [ @@ -176,6 +83,7 @@ EOH tags = [ "grafana", "tricot grafana.deuxfleurs.fr", + "d53-cname grafana.deuxfleurs.fr", ] port = 3719 address_mode = "driver" diff --git a/cluster/prod/app/telemetry/deploy/telemetry-storage.hcl b/cluster/prod/app/telemetry/deploy/telemetry-storage.hcl new file mode 100644 index 0000000..bf64719 --- /dev/null +++ b/cluster/prod/app/telemetry/deploy/telemetry-storage.hcl @@ -0,0 +1,97 @@ +job "telemetry-storage" { + datacenters = ["neptune", "bespin"] + type = "service" + + group "prometheus" { + count = 2 + + network { + port "prometheus" { + static = 9090 + } + } + + constraint { + attribute = "${attr.unique.hostname}" + operator = "set_contains_any" + value = "concombre,df-ymk" + } + + task "prometheus" { + driver = "docker" + config { + image = "prom/prometheus:v2.41.0" + network_mode = "host" + ports = [ "prometheus" ] + args = [ + "--config.file=/etc/prometheus/prometheus.yml", + "--storage.tsdb.path=/data", + "--storage.tsdb.retention.size=20GB", + ] + volumes = [ + "secrets:/etc/prometheus", + "/mnt/ssd/prometheus:/data" + ] + } + + template { + data = file("../config/prometheus.yml") + destination = "secrets/prometheus.yml" + } + + template { + data = "{{ key \"secrets/consul/consul-ca.crt\" }}" + destination = "secrets/consul-ca.crt" + } + + template { + data = "{{ key \"secrets/consul/consul-client.crt\" }}" + destination = "secrets/consul-client.crt" + } + + template { + data = "{{ key \"secrets/consul/consul-client.key\" }}" + destination = "secrets/consul-client.key" + } + + template { + data = "{{ key \"secrets/nomad/nomad-ca.crt\" }}" + destination = "secrets/nomad-ca.crt" + } + + template { + data = "{{ key \"secrets/nomad/nomad-client.crt\" }}" + destination = "secrets/nomad-client.crt" + } + + template { + data = "{{ key \"secrets/nomad/nomad-client.key\" }}" + destination = "secrets/nomad-client.key" + } + + resources { + memory = 1000 + cpu = 1000 + } + + service { + port = 9090 + address_mode = "driver" + name = "prometheus" + check { + type = "http" + path = "/" + port = 9090 + address_mode = "driver" + interval = "60s" + timeout = "5s" + check_restart { + limit = 3 + grace = "90s" + ignore_warnings = false + } + } + } + } + } +} |