From 852b3aa032bc3a6fa0575b103681a4b6dccc4eef Mon Sep 17 00:00:00 2001 From: Ondrej Kuchar Date: Mon, 18 Mar 2019 11:13:15 +0100 Subject: [PATCH] [stable/prometheus-operator] Possibility to add grafana datasources (#12296) * [stable/prometheus-operator] Possibility to add grafana datasources Signed-off-by: Ondrej Kuchar * [stable/prometheus-operator] add additionalDataSources to ci dir Signed-off-by: Ondrej Kuchar --- stable/prometheus-operator/Chart.yaml | 2 +- stable/prometheus-operator/README.md | 1 + stable/prometheus-operator/ci/test-values.yaml | 18 ++++++++++++++++++ .../grafana/configmaps-datasources.yaml | 5 ++++- stable/prometheus-operator/values.yaml | 16 ++++++++++++++++ 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/stable/prometheus-operator/Chart.yaml b/stable/prometheus-operator/Chart.yaml index b8190415bc..98187fdb3b 100644 --- a/stable/prometheus-operator/Chart.yaml +++ b/stable/prometheus-operator/Chart.yaml @@ -9,7 +9,7 @@ name: prometheus-operator sources: - https://github.com/coreos/prometheus-operator - https://coreos.com/operators/prometheus -version: 4.3.4 +version: 4.3.5 appVersion: 0.29.0 home: https://github.com/coreos/prometheus-operator keywords: diff --git a/stable/prometheus-operator/README.md b/stable/prometheus-operator/README.md index 8d23e5d86f..c1d27b204f 100644 --- a/stable/prometheus-operator/README.md +++ b/stable/prometheus-operator/README.md @@ -285,6 +285,7 @@ The following tables list the configurable parameters of the prometheus-operator | ----- | ----------- | ------ | | `grafana.enabled` | If true, deploy the grafana sub-chart | `true` | | `grafana.serviceMonitor.selfMonitor` | Create a `serviceMonitor` to automatically monitor the grafana instance | `true` | +| `grafana.additionalDataSources` | Configure additional grafana datasources | `[]` | | `grafana.adminPassword` | Admin password to log into the grafana UI | "prom-operator" | | `grafana.defaultDashboardsEnabled` | Deploy default dashboards. These are loaded using the sidecar | `true` | | `grafana.ingress.enabled` | Enables Ingress for Grafana | `false` | diff --git a/stable/prometheus-operator/ci/test-values.yaml b/stable/prometheus-operator/ci/test-values.yaml index de8499fac3..af9726d8eb 100644 --- a/stable/prometheus-operator/ci/test-values.yaml +++ b/stable/prometheus-operator/ci/test-values.yaml @@ -362,6 +362,24 @@ grafana: serviceMonitor: selfMonitor: true + ## Configure additional grafana datasources + ## ref: http://docs.grafana.org/administration/provisioning/#datasources + ## + additionalDataSources: [] + # - name: prometheus-sample + # access: proxy + # basicAuth: true + # basicAuthPassword: pass + # basicAuthUser: daco + # editable: false + # jsonData: + # tlsSkipVerify: true + # orgId: 1 + # type: prometheus + # url: https://prometheus.svc:9090 + # version: 1 + + ## Component scraping the kube api server ## kubeApiServer: diff --git a/stable/prometheus-operator/templates/grafana/configmaps-datasources.yaml b/stable/prometheus-operator/templates/grafana/configmaps-datasources.yaml index 5b8b54c4ee..8c1c351d47 100644 --- a/stable/prometheus-operator/templates/grafana/configmaps-datasources.yaml +++ b/stable/prometheus-operator/templates/grafana/configmaps-datasources.yaml @@ -16,4 +16,7 @@ data: url: http://{{ template "prometheus-operator.fullname" . }}-prometheus:9090/{{ trimPrefix "/" .Values.prometheus.prometheusSpec.routePrefix }} access: proxy isDefault: true -{{- end }} \ No newline at end of file +{{- if .Values.grafana.additionalDataSources }} +{{ toYaml .Values.grafana.additionalDataSources | indent 4}} +{{- end }} +{{- end }} diff --git a/stable/prometheus-operator/values.yaml b/stable/prometheus-operator/values.yaml index cbb3140309..2db01f6970 100644 --- a/stable/prometheus-operator/values.yaml +++ b/stable/prometheus-operator/values.yaml @@ -357,6 +357,22 @@ grafana: # configMap: certs-configmap # readOnly: true + ## Configure additional grafana datasources + ## ref: http://docs.grafana.org/administration/provisioning/#datasources + additionalDataSources: [] + # - name: prometheus-sample + # access: proxy + # basicAuth: true + # basicAuthPassword: pass + # basicAuthUser: daco + # editable: false + # jsonData: + # tlsSkipVerify: true + # orgId: 1 + # type: prometheus + # url: https://prometheus.svc:9090 + # version: 1 + ## If true, create a serviceMonitor for grafana ## serviceMonitor: