---
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: monitoring
  name: prometheus-config-template
data:
  prometheus.yml.tmpl: |
    global:
      scrape_interval: 30s
      scrape_timeout: 10s
      evaluation_interval: 30s

    scrape_configs:
    - job_name: simple-http-blackbox-exporter
      scrape_interval: 15s
      scrape_timeout: 10s
      metrics_path: /metrics
      scheme: http
      kubernetes_sd_configs:
      - role: service
        namespaces:
          names:
          - monitoring
      relabel_configs:
      - source_labels: [__meta_kubernetes_service_name]
        separator: ;
        regex: simple-http-blackbox-exporter
        replacement: $1
        action: keep
      - source_labels: [__address__]
        target_label: instance
      - action: labelmap
        regex: __meta_kubernetes_service_label_(.+)
