apiVersion: v1
kind: ConfigMap
metadata:
  name: "{{ .Values.prometheus.volume.config.name }}"
  namespace: "{{ .Values.prometheus.namespace }}"
data:
  prometheus.yml: |
    global:
      scrape_interval: 30s
      scrape_timeout: 10s
      evaluation_interval: 5s
    scrape_configs:
      - job_name: prometheus
        scheme: http
        static_configs:
          - targets:
            - localhost:{{ .Values.prometheus.service.ports.port }}
      - job_name: grafana
        scheme: http
        static_configs:
          - targets:
            - {{ .Values.grafana.name }}.{{ .Values.grafana.namespace }}.svc.cluster.local:{{ .Values.grafana.service.ports.port }}
      - job_name: traefik
        scheme: http
        static_configs:
          - targets:
            - {{ .Values.traefik.name }}.{{ .Values.traefik.namespace }}.svc.cluster.local:{{ .Values.traefik.service.ports.admin.port }}
