File tree Expand file tree Collapse file tree 3 files changed +81
-3
lines changed
production/nomad/loki-simple Expand file tree Collapse file tree 3 files changed +81
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ To deploy a different version change `variable.version` default value or specify
2222from command line:
2323
2424``` shell
25- nomad job run -var=" version=2.7.5 " job.nomad.hcl
25+ nomad job run -var=" version=3.5.7 " job.nomad.hcl
2626```
2727
2828### Scale Loki
Original file line number Diff line number Diff line change 99 replication_factor : 1
1010 # Tell Loki which address to advertise
1111 instance_addr : {{ env "NOMAD_IP_grpc" }}
12+ # Add the compactor address
13+ compactor_address : http://loki-backend.service.consul
1214 ring :
1315 # Tell Loki which address to advertise in ring
1416 instance_addr : {{ env "NOMAD_IP_grpc" }}
@@ -35,7 +37,7 @@ schema_config:
3537 period : 24h
3638
3739storage_config :
38- boltdb_shipper :
40+ tsdb_shipper :
3941 # Nomad ephemeral disk is used to store index and cache
4042 # it will try to preserve /alloc/data between job updates
4143 active_index_directory : {{ env "NOMAD_ALLOC_DIR" }}/data/index
Original file line number Diff line number Diff line change 11variable "version" {
22 type = string
33 description = " Loki version"
4- default = " 2.7.5 "
4+ default = " 3.5.7 "
55}
66
77job "loki" {
@@ -83,6 +83,82 @@ job "loki" {
8383 }
8484 }
8585
86+ group "backend" {
87+ count = 1
88+
89+ ephemeral_disk {
90+ size = 1000
91+ sticky = true
92+ }
93+
94+ network {
95+ port "http" {}
96+ port "grpc" {}
97+ }
98+
99+ task "backend" {
100+ driver = " docker"
101+ user = " nobody"
102+
103+ config {
104+ image = " grafana/loki:${ var . version } "
105+
106+ ports = [
107+ " http" ,
108+ " grpc" ,
109+ ]
110+
111+ args = [
112+ " -target=backend" ,
113+ " -config.file=/local/config.yml" ,
114+ " -config.expand-env=true" ,
115+ ]
116+ }
117+
118+ template {
119+ data = file (" config.yml" )
120+ destination = " local/config.yml"
121+ }
122+
123+ template {
124+ data = <<- EOH
125+ S3_ACCESS_KEY_ID=<access_key>
126+ S3_SECRET_ACCESS_KEY=<secret_access_key>
127+ EOH
128+
129+ destination = " secrets/s3.env"
130+ env = true
131+ }
132+
133+ service {
134+ name = " loki-backend"
135+ port = " http"
136+
137+ tags = [
138+ " traefik.enable=true" ,
139+ " traefik.http.routers.loki-backend.entrypoints=https" ,
140+ " traefik.http.routers.loki-backend.rule=Host(`loki-backend.service.consul`)" ,
141+ ]
142+
143+ check {
144+ name = " Loki backend"
145+ port = " http"
146+ type = " http"
147+ path = " /ready"
148+ interval = " 20s"
149+ timeout = " 1s"
150+
151+ initial_status = " passing"
152+ }
153+ }
154+
155+ resources {
156+ cpu = 500
157+ memory = 256
158+ }
159+ }
160+ }
161+
86162 group "write" {
87163 count = 2
88164
You can’t perform that action at this time.
0 commit comments