Skip to content

Commit b89f9a4

Browse files
authored
refactor: do not use templates/loki-stack-values.yaml and set necessary values in the eks-loki-stack.tf file (#198)
1 parent 770e1f6 commit b89f9a4

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

terraform/layer2-k8s/eks-loki-stack.tf

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,49 @@ locals {
44
enabled = local.helm_releases[index(local.helm_releases.*.id, "loki-stack")].enabled
55
chart = local.helm_releases[index(local.helm_releases.*.id, "loki-stack")].chart
66
repository = local.helm_releases[index(local.helm_releases.*.id, "loki-stack")].repository
7-
chart_version = local.helm_releases[index(local.helm_releases.*.id, "loki-stack")].version
7+
chart_version = local.helm_releases[index(local.helm_releases.*.id, "loki-stack")].chart_version
88
namespace = local.helm_releases[index(local.helm_releases.*.id, "loki-stack")].namespace
99
}
10+
loki_stack_values = <<VALUES
11+
loki:
12+
enabled: true
13+
config:
14+
limits_config:
15+
enforce_metric_name: false
16+
reject_old_samples: true
17+
reject_old_samples_max_age: 168h
18+
persistence:
19+
enabled: true
20+
accessModes:
21+
- ReadWriteOnce
22+
size: 10Gi
23+
storageClassName: advanced
24+
serviceMonitor:
25+
enabled: true
26+
scrapeTimeout: 10s
27+
affinity:
28+
nodeAffinity:
29+
requiredDuringSchedulingIgnoredDuringExecution:
30+
nodeSelectorTerms:
31+
- matchExpressions:
32+
- key: eks.amazonaws.com/capacityType
33+
operator: In
34+
values:
35+
- ON_DEMAND
36+
37+
promtail:
38+
enabled: true
39+
serviceMonitor:
40+
enabled: true
41+
tolerations:
42+
- effect: NoSchedule
43+
operator: Exists
44+
45+
fluent-bit:
46+
enabled: false
47+
grafana:
48+
enabled: false
49+
VALUES
1050
}
1151

1252
#tfsec:ignore:kubernetes-network-no-public-egress tfsec:ignore:kubernetes-network-no-public-ingress
@@ -100,7 +140,7 @@ resource "helm_release" "loki_stack" {
100140
max_history = var.helm_release_history_size
101141

102142
values = [
103-
file("${path.module}/templates/loki-stack-values.yaml")
143+
local.loki_stack_values
104144
]
105145

106146
depends_on = [helm_release.prometheus_operator]

terraform/layer2-k8s/helm-releases.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ releases:
111111
enabled: true
112112
chart: loki-stack
113113
repository: https://grafana.github.io/helm-charts
114-
version: 2.3.1
114+
chart_version: 2.3.1
115115
namespace: loki
116116
- id: reloader
117117
enabled: true

terraform/layer2-k8s/templates/loki-stack-values.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)