From 420df226fd7e622dfc3cb9d7ba8941a972719b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Mon, 15 Apr 2024 13:02:31 +0200 Subject: [PATCH] [kube-prometheus-stack] Thanos Ruler: Support omit externalPrefix with externalPrefixNilUsesHelmValues=true, if ingress is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../kube-prometheus-stack/templates/thanos-ruler/ruler.yaml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 5a7b6409d86a..72c2bb662d85 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -23,7 +23,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 58.1.1 +version: 58.1.2 appVersion: v0.73.1 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml b/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml index 908d6a45aa42..30491c7d8a02 100644 --- a/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml +++ b/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml @@ -31,10 +31,12 @@ spec: listenLocal: {{ .Values.thanosRuler.thanosRulerSpec.listenLocal }} serviceAccountName: {{ template "kube-prometheus-stack.thanosRuler.serviceAccountName" . }} {{- if .Values.thanosRuler.thanosRulerSpec.externalPrefix }} - externalPrefix: "{{ tpl .Values.thanosRuler.thanosRulerSpec.externalPrefix . }}" + externalPrefix: {{ tpl .Values.thanosRuler.thanosRulerSpec.externalPrefix . | quote }} +{{- else if .Values.thanosRuler.thanosRulerSpec.externalPrefixNilUsesHelmValues }} + {{- /** If externalPrefix is empty and externalPrefixNilUsesHelmValues=true, omit externalPrefix **/}} {{- else if and .Values.thanosRuler.ingress.enabled .Values.thanosRuler.ingress.hosts }} externalPrefix: "http://{{ tpl (index .Values.thanosRuler.ingress.hosts 0) . }}{{ .Values.thanosRuler.thanosRulerSpec.routePrefix }}" -{{- else if .Values.thanosRuler.thanosRulerSpec.externalPrefixNilUsesHelmValues }} +{{- else }} externalPrefix: "http://{{ template "kube-prometheus-stack.thanosRuler.name" . }}.{{ template "kube-prometheus-stack.namespace" . }}:{{ .Values.thanosRuler.service.port }}" {{- end }} {{- if .Values.thanosRuler.thanosRulerSpec.additionalArgs }}