-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobservability.tf
59 lines (51 loc) · 1.9 KB
/
observability.tf
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
resource "kubernetes_namespace" "observability-namespace" {
count = var.observability ? 1 : 0
metadata {
name = "observability"
}
}
# Helm chart for Grafana
resource "helm_release" "grafana" {
name = "grafana"
repository = "https://grafana.github.io/helm-charts"
chart = "grafana"
version = "8.10.0"
namespace = "observability"
count = var.observability_grafana ? 1 : 0
values = [file("${path.module}/values/grafana.yaml")]
depends_on = [ kubernetes_namespace.observability-namespace ]
}
# Helm chart for Loki
resource "helm_release" "loki" {
name = "loki"
repository = "https://grafana.github.io/helm-charts"
chart = "loki"
version = "6.27.0"
namespace = "observability"
count = var.observability_loki ? 1 : 0
values = [file("${path.module}/values/loki.yaml")]
depends_on = [ kubernetes_namespace.observability-namespace ]
}
# Helm chart for promtail
resource "helm_release" "promtail" {
name = "promtail"
repository = "https://grafana.github.io/helm-charts"
chart = "promtail"
version = "6.16.3"
namespace = "observability"
count = var.observability_promtail ? 1 : 0
values = [file("${path.module}/values/promtail.yaml")]
depends_on = [ kubernetes_namespace.observability-namespace ]
}
resource "helm_release" "kube-prometheus" {
name = "kube-prometheus-stack"
repository = "https://prometheus-community.github.io/helm-charts"
chart = "kube-prometheus-stack"
version = "69.5.1"
namespace = "observability"
count = var.observability_kube-prometheus ? 1 : 0
values = [file("${path.module}/values/prometheus.yaml")]
# may be here https://github.com/tiagoangelototvs/testkube-playground/blob/main/prometheus.tf
# values https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack
depends_on = [ kubernetes_namespace.observability-namespace ]
}