Skip to content

Commit 50de7f2

Browse files
Update main.tf
1 parent 3a7e19b commit 50de7f2

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

main.tf

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ metadata:
2121
YAML
2222
}
2323

24+
# Apply Prometheus cluster-role YAML
25+
resource "kubectl_manifest" "prometheus_cluster_role" {
26+
yaml_body = file("${path.module}/manifests/prometheus-cluster-role.yaml")
27+
depends_on = [kubectl_manifest.monitoring_namespace]
28+
}
2429
# Apply Prometheus ConfigMap YAML
2530
resource "kubectl_manifest" "prometheus_config" {
26-
yaml_body = file("${path.module}/manifests/prometheus-config.yaml")
31+
yaml_body = file("${path.module}/manifests/prometheus-config-map.yaml")
2732
depends_on = [kubectl_manifest.monitoring_namespace]
2833
}
2934

@@ -34,7 +39,7 @@ resource "kubectl_manifest" "prometheus_service" {
3439
}
3540

3641
locals {
37-
prometheus_config_hash = filesha256("${path.module}/manifests/prometheus-config.yaml")
42+
prometheus_config_hash = filesha256("${path.module}/manifests/prometheus-config-map.yaml")
3843
prometheus_service_hash = filesha256("${path.module}/manifests/prometheus-service.yaml")
3944
prometheus_deployment_hash = filesha256("${path.module}/manifests/prometheus-deployment.yaml")
4045

@@ -55,31 +60,34 @@ resource "kubectl_manifest" "prometheus_deployment" {
5560
}
5661

5762

63+
64+
65+
5866
# Deploy Node Exporter DaemonSet + Service
59-
resource "kubectl_manifest" "node_exporter" {
60-
yaml_body = file("${path.module}/manifests/node-exporter.yaml")
61-
depends_on = [kubectl_manifest.monitoring_namespace]
62-
}
67+
#resource "kubectl_manifest" "node_exporter" {
68+
# yaml_body = file("${path.module}/manifests/node-exporter.yaml")
69+
#depends_on = [kubectl_manifest.monitoring_namespace]
70+
#}
6371

6472
# Deploy Node Exporter DaemonSet - Service
6573

6674

67-
resource "kubectl_manifest" "node-exporter-service" {
68-
yaml_body = file("${path.module}/manifests/node-exporter-service.yaml")
69-
depends_on = [kubectl_manifest.monitoring_namespace]
70-
}
75+
#resource "kubectl_manifest" "node-exporter-service" {
76+
# yaml_body = file("${path.module}/manifests/node-exporter-service.yaml")
77+
#depends_on = [kubectl_manifest.monitoring_namespace]
78+
#}
7179

7280
# (Optional) Use SHA hash to force reapply if manifest changes
73-
locals {
74-
node_exporter_hash = filesha256("${path.module}/manifests/node-exporter.yaml")
75-
}
76-
77-
resource "null_resource" "trigger_node_exporter_restart" {
78-
triggers = {
79-
config_hash = local.node_exporter_hash
80-
}
81-
82-
provisioner "local-exec" {
83-
command = "kubectl rollout restart daemonset/node-exporter -n monitoring || true"
84-
}
85-
}
81+
#locals {
82+
# node_exporter_hash = filesha256("${path.module}/manifests/node-exporter.yaml")
83+
#}
84+
85+
#resource "null_resource" "trigger_node_exporter_restart" {
86+
# triggers = {
87+
# config_hash = local.node_exporter_hash
88+
#}
89+
90+
#provisioner "local-exec" {
91+
# command = "kubectl rollout restart daemonset/node-exporter -n monitoring || true"
92+
#}
93+
#}

0 commit comments

Comments
 (0)