This commit is contained in:
2024-05-23 19:02:24 +02:00
parent c6bb50fca4
commit 8a08647dd6
20 changed files with 610 additions and 458 deletions

View File

@@ -0,0 +1,34 @@
resource "kubectl_manifest" "PodMonitor_sonarqube" {
count = var.conditions.have_podmonitors?1:0
yaml_body = <<-EOF
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: sonarqube
namespace: ${var.namespace}
labels: ${jsonencode(local.sonar_all_labels)}
spec:
namespaceSelector:
matchNames:
- ${var.namespace}
selector:
matchLabels: ${jsonencode(local.sonar_labels)}
podMetricsEndpoints:
- port: http
path: /api/monitoring/metrics
scheme: http
interval: 30s
bearerTokenSecret:
name: ${kubectl_manifest.secret.name}
key: SONAR_WEB_SYSTEMPASSCODE
- port: monitoring-ce
path: /
scheme: http
interval: 30s
- port: monitoring-web
path: /
scheme: http
interval: 30s
EOF
}