apiVersion: v1
kind: ConfigMap

metadata:
  name: kubernikus-grafana-default-datasource
  labels:
    grafana-datasource: "true"

data:
  grafana-default-datasource.yaml: |
    datasources:
      - name: Prometheus
        type: prometheus
        access: proxy
        org_id: 1
        url: http://prometheus-kubernikus:9090
        is_default: true
        version: 1
        editable: false

      {{ if .Values.loki.enabled -}}
      - name: Loki
        type: loki
        access: proxy
        url: http://kube-monitoring-kubernikus-loki:3100
        version: 1
      {{- end }}
