Add Node Exporter and Fail2Ban Exporter modules: implement Kubernetes resources and Prometheus scrape configurations

This commit is contained in:
2025-10-02 20:02:53 +02:00
parent a412c96c46
commit 0a0d4c9c15
14 changed files with 255 additions and 272 deletions
+4
View File
@@ -62,3 +62,7 @@ module "grafana" {
persistent_folder = "${local.persistent_folder}/monitoring"
fqdn = local.grafana_fqdn
}
module "node_exporter" {
source = "../../modules/utils/node-exporter"
}
@@ -36,3 +36,9 @@ scrape_configs:
regex: '^/system\.slice/(.+)\.service$'
target_label: systemd_service_name
replacement: "${1}"
- job_name: node-exporter
scrape_interval: 10s
static_configs:
- targets:
- "node-exporter.kube-system.svc.cluster.local:9100"
- "10.19.4.1:9100"
+8
View File
@@ -135,3 +135,11 @@ module "prometheus" {
persistent_folder = "${local.persistent_folder}/monitoring"
config = file("${path.module}/resources/prometheus.yml")
}
module "fail2ban_exporter" {
source = "../../modules/utils/fail2ban-exporter"
}
module "node_exporter" {
source = "../../modules/utils/node-exporter"
}
@@ -36,5 +36,11 @@ scrape_configs:
regex: '^/system\.slice/(.+)\.service$'
target_label: systemd_service_name
replacement: "${1}"
remote_write:
- url: "http://prometheus.reverse-proxy.svc.cluster.local:9090/api/v1/write"
- job_name: node-exporter
scrape_interval: 10s
static_configs:
- targets: ["node-exporter.kube-system.svc.cluster.local:9100"]
- job_name: fail2ban
scrape_interval: 60s
static_configs:
- targets: ["fail2ban-exporter.kube-system.svc.cluster.local:9100"]