diff --git a/charts/prometheus-elasticsearch-exporter/Chart.yaml b/charts/prometheus-elasticsearch-exporter/Chart.yaml index d8a4ba31d04c..186fdd65635a 100644 --- a/charts/prometheus-elasticsearch-exporter/Chart.yaml +++ b/charts/prometheus-elasticsearch-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Elasticsearch stats exporter for Prometheus name: prometheus-elasticsearch-exporter -version: 5.7.0 +version: 5.8.0 kubeVersion: ">=1.10.0-0" appVersion: "v1.7.0" home: https://github.com/prometheus-community/elasticsearch_exporter diff --git a/charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl b/charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl index 8a6e84852a71..68983e0dfb01 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl +++ b/charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl @@ -83,3 +83,18 @@ imagePullSecrets: {{- end }} {{- end }} {{- end -}} + +{{/* +Return the correct (overridden global) image registry. +*/}} +{{- define "elasticsearch-exporter.image.repository" -}} + {{- $registry := .Values.image.registry -}} + {{- if .Values.global.imageRegistry }} + {{- $registry = .Values.global.imageRegistry -}} + {{- end }} + {{- if $registry -}} + {{- printf "%s/%s" $registry .Values.image.repository -}} + {{- else -}} + {{- printf "%s" .Values.image.repository -}} + {{- end }} +{{- end -}} diff --git a/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml b/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml index 589176ef624e..7ffb349c07ca 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml @@ -75,7 +75,7 @@ spec: - secretRef: name: {{ .Values.envFromSecret }} {{- end }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{- include "elasticsearch-exporter.image.repository" . }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: ["elasticsearch_exporter", {{- with .Values.log.format }} diff --git a/charts/prometheus-elasticsearch-exporter/values.yaml b/charts/prometheus-elasticsearch-exporter/values.yaml index dcf5d4d19f0e..acd4a0548fea 100644 --- a/charts/prometheus-elasticsearch-exporter/values.yaml +++ b/charts/prometheus-elasticsearch-exporter/values.yaml @@ -3,6 +3,7 @@ ## to set the same values for each chart (and image) separately global: imagePullSecrets: [] + imageRegistry: "" ## number of exporter instances ## @@ -13,6 +14,7 @@ replicaCount: 1 restartPolicy: Always image: + registry: "" repository: quay.io/prometheuscommunity/elasticsearch-exporter # if not set appVersion field from Chart.yaml is used tag: ""