-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
70 lines (62 loc) · 1.65 KB
/
main.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
63
64
65
66
67
68
69
provider "helm" {
kubernetes {
config_context_cluster = "minikube"
config_path = "~/.kube/config"
}
}
provider "kubernetes" {
config_context_cluster = "minikube"
config_path = "~/.kube/config"
}
locals {
argo_namespace = "argo"
monitoring_namespace = "monitoring"
}
resource "kubernetes_namespace" "argo-namespace" {
metadata {
name = local.argo_namespace
}
}
resource "kubernetes_namespace" "monitoring-namespace" {
metadata {
name = local.monitoring_namespace
}
}
resource "helm_release" "prometheus" {
name = "prometheus"
repository = "https://prometheus-community.github.io/helm-charts"
chart = "kube-prometheus-stack"
namespace = local.monitoring_namespace
# Find ServiceMonitor in all namespaces
# More: https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/README.md#prometheusioscrape
set {
name = "prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues"
value = false
}
set {
name = "prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues"
value = false
}
depends_on = [
kubernetes_namespace.monitoring-namespace
]
}
resource "helm_release" "argo-workflow" {
name = "argo-workflow"
repository = "https://argoproj.github.io/argo-helm"
chart = "argo"
version = "0.15.2"
namespace = local.argo_namespace
set {
name = "controller.serviceMonitor.enabled"
value = true
}
set {
name = "controller.metricsConfig.enabled"
value = true
}
depends_on = [
kubernetes_namespace.argo-namespace,
helm_release.prometheus # Needs ServiceMonitor
]
}