35 lines
882 B
HCL
35 lines
882 B
HCL
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
|
|
}
|
|
|