diff --git a/stable/prometheus-operator/Chart.yaml b/stable/prometheus-operator/Chart.yaml index 0b926991da..de38760d69 100644 --- a/stable/prometheus-operator/Chart.yaml +++ b/stable/prometheus-operator/Chart.yaml @@ -11,7 +11,7 @@ name: prometheus-operator sources: - https://github.com/coreos/prometheus-operator - https://coreos.com/operators/prometheus -version: 5.18.0 +version: 5.19.0 appVersion: 0.31.1 home: https://github.com/coreos/prometheus-operator keywords: diff --git a/stable/prometheus-operator/README.md b/stable/prometheus-operator/README.md index a0c1e3b1e8..6d9717930d 100644 --- a/stable/prometheus-operator/README.md +++ b/stable/prometheus-operator/README.md @@ -333,7 +333,8 @@ For a full list of configurable values please refer to the [Grafana chart](https | `grafana.sidecar.dashboards.enabled` | Enable the Grafana sidecar to automatically load dashboards with a label `{{ grafana.sidecar.dashboards.label }}=1` | `true` | | `grafana.sidecar.dashboards.label` | If the sidecar is enabled, configmaps with this label will be loaded into Grafana as dashboards | `grafana_dashboard` | | `grafana.sidecar.datasources.enabled` | Enable the Grafana sidecar to automatically load dashboards with a label `{{ grafana.sidecar.datasources.label }}=1` | `true` | -| `grafana.sidecar.datasources.defaultDatasourceEnabled` | Enable Grafana `Prometheus` default datasource` | `true` | +| `grafana.sidecar.datasources.defaultDatasourceEnabled` | Enable Grafana `Prometheus` default datasource | `true` | +| `grafana.sidecar.datasources.createPrometheusReplicasDatasources` | Create datasource for each Pod of Prometheus StatefulSet i.e. `Prometheus-0`, `Prometheus-1` | `false` | | `grafana.sidecar.datasources.label` | If the sidecar is enabled, configmaps with this label will be loaded into Grafana as datasources configurations | `grafana_datasource` | | `grafana.rbac.pspUseAppArmor` | Enforce AppArmor in created PodSecurityPolicy (requires rbac.pspEnabled) | `true` | | `grafana.extraConfigmapMounts` | Additional grafana server configMap volume mounts | `[]` | diff --git a/stable/prometheus-operator/templates/grafana/configmaps-datasources.yaml b/stable/prometheus-operator/templates/grafana/configmaps-datasources.yaml index ca19d0e3c3..a359bb7f8e 100644 --- a/stable/prometheus-operator/templates/grafana/configmaps-datasources.yaml +++ b/stable/prometheus-operator/templates/grafana/configmaps-datasources.yaml @@ -17,6 +17,15 @@ data: url: http://{{ template "prometheus-operator.fullname" . }}-prometheus:9090/{{ trimPrefix "/" .Values.prometheus.prometheusSpec.routePrefix }} access: proxy isDefault: true +{{- if .Values.grafana.sidecar.datasources.createPrometheusReplicasDatasources }} +{{- range until (int .Values.prometheus.prometheusSpec.replicas) }} + - name: Prometheus-{{ . }} + type: prometheus + url: http://prometheus-{{ template "prometheus-operator.fullname" $ }}-prometheus-{{ . }}.prometheus-operated:9090/{{ trimPrefix "/" $.Values.prometheus.prometheusSpec.routePrefix }} + access: proxy + isDefault: false +{{- end }} +{{- end }} {{- end }} {{- if .Values.grafana.additionalDataSources }} {{ toYaml .Values.grafana.additionalDataSources | indent 4}} diff --git a/stable/prometheus-operator/values.yaml b/stable/prometheus-operator/values.yaml index 1569bcc364..eac14bdec4 100644 --- a/stable/prometheus-operator/values.yaml +++ b/stable/prometheus-operator/values.yaml @@ -411,6 +411,11 @@ grafana: datasources: enabled: true defaultDatasourceEnabled: true + ## Create datasource for each Pod of Prometheus StatefulSet; + ## this uses headless service `prometheus-operated` which is + ## created by Prometheus Operator + ## ref: https://git.io/fjaBS + createPrometheusReplicasDatasources: false label: grafana_datasource extraConfigmapMounts: []