Move Prometheus-operator to operator package
[demo.git] / vnfs / DAaaS / operator / charts / prometheus-operator / templates / grafana / configmaps-datasources.yaml
diff --git a/vnfs/DAaaS/operator/charts/prometheus-operator/templates/grafana/configmaps-datasources.yaml b/vnfs/DAaaS/operator/charts/prometheus-operator/templates/grafana/configmaps-datasources.yaml
new file mode 100644 (file)
index 0000000..5b8b54c
--- /dev/null
@@ -0,0 +1,19 @@
+{{- if and .Values.grafana.enabled .Values.grafana.sidecar.datasources.enabled }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ template "prometheus-operator.fullname" . }}-grafana-datasource
+  labels:
+    {{ $.Values.grafana.sidecar.datasources.label }}: "1"
+    app: {{ template "prometheus-operator.name" $ }}-grafana
+{{ include "prometheus-operator.labels" $ | indent 4 }}
+data:
+  datasource.yaml: |-
+    apiVersion: 1
+    datasources:
+    - name: Prometheus
+      type: prometheus
+      url: http://{{ template "prometheus-operator.fullname" . }}-prometheus:9090/{{ trimPrefix "/" .Values.prometheus.prometheusSpec.routePrefix }}
+      access: proxy
+      isDefault: true
+{{- end }}
\ No newline at end of file