aboutsummaryrefslogtreecommitdiff
path: root/cluster/prod/app/telemetry/deploy/telemetry-storage.hcl
blob: 845f4b0f6cfed284410824a3fd3433f58278cf86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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 = "celeri,df-ymk"
    }

    task "prometheus" {
      driver = "docker"
      config {
        image = "prom/prometheus:v2.46.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
          }
        }
      }
    }
  }
}