-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s-kube-prometheus.tf
64 lines (51 loc) · 1.52 KB
/
k8s-kube-prometheus.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
60
61
62
resource "kubernetes_namespace" "monitoring" {
metadata {
name = "monitoring"
annotations = {}
labels = {}
}
}
resource "helm_release" "monitoring" {
name = "monitoring"
repository = "https://prometheus-community.github.io/helm-charts"
chart = "kube-prometheus-stack"
namespace = kubernetes_namespace.monitoring.metadata[0].name
values = [<<EOF
alertmanager:
ingress:
enabled: true
ingressClassName: "nginx"
annotations:
external-dns.alpha.kubernetes.io/target: tunnel-origin.${var.domain_name}
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: ${kubectl_manifest.letsencrypt-prod.name}
hosts:
- alertmanager.${var.domain_name}
grafana:
enabled: true
namespaceOverride: ""
adminPassword: ${random_password.bootstrap_password.result}
ingress:
enabled: true
ingressClassName: "nginx"
annotations:
external-dns.alpha.kubernetes.io/target: tunnel-origin.${var.domain_name}
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: ${kubectl_manifest.letsencrypt-prod.name}
hosts:
- grafana.${var.domain_name}
prometheus:
enabled: true
namespaceOverride: ""
ingress:
enabled: true
ingressClassName: "nginx"
annotations:
external-dns.alpha.kubernetes.io/target: tunnel-origin.${var.domain_name}
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: ${kubectl_manifest.letsencrypt-prod.name}
hosts:
- prometheus.${var.domain_name}
EOF
]
}