diff --git a/charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml b/charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml index ddd6f25e74c0..acab7fd9aeda 100644 --- a/charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml +++ b/charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml @@ -8,13 +8,19 @@ metadata: app: {{ include "kube-prometheus-stack.thanosRuler.name" . }} {{ include "kube-prometheus-stack.labels" . | indent 4 }} data: -{{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.secret }} - alertmanager-configs.yaml: {{ toYaml .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.secret | b64enc | quote }} -{{- end }} -{{- if .Values.thanosRuler.thanosRulerSpec.objectStorageConfig.secret }} - object-storage-configs.yaml: {{ toYaml .Values.thanosRuler.thanosRulerSpec.objectStorageConfig.secret | b64enc | quote }} -{{- end }} -{{- if .Values.thanosRuler.thanosRulerSpec.queryConfig.secret }} - query-configs.yaml: {{ toYaml .Values.thanosRuler.thanosRulerSpec.queryConfig.secret | b64enc | quote }} -{{- end }} + {{- with .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig }} + {{- if and .secret (not .existingSecret) }} + alertmanager-configs.yaml: {{ toYaml .secret | b64enc | quote }} + {{- end }} + {{- end }} + {{- with .Values.thanosRuler.thanosRulerSpec.objectStorageConfig }} + {{- if and .secret (not .existingSecret) }} + object-storage-configs.yaml: {{ toYaml .secret | b64enc | quote }} + {{- end }} + {{- end }} + {{- with .Values.thanosRuler.thanosRulerSpec.queryConfig }} + {{- if and .secret (not .existingSecret) }} + query-configs.yaml: {{ toYaml .secret | b64enc | quote }} + {{- end }} + {{- end }} {{- end }} diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 650d358e8ab8..6368d75e7bd3 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -3966,7 +3966,7 @@ thanosRuler: existingSecret: {} # name: "" # key: "" - # will render alertmanagersConfig + # will render render alertmanagersConfig secret data and configure it to be used by Thanos Ruler custom resource, ignored when alertmanagersConfig.existingSecret is set # https://thanos.io/tip/components/rule.md/#alertmanager secret: {} # alertmanagers: @@ -4000,7 +4000,7 @@ thanosRuler: existingSecret: {} # name: "" # key: "" - # will render objectStorageConfig + # will render objectStorageConfig secret data and configure it to be used by Thanos Ruler custom resource, ignored when alertmanagersConfig.existingSecret is set # https://thanos.io/tip/thanos/storage.md/#s3 secret: {} # type: S3 @@ -4026,7 +4026,7 @@ thanosRuler: existingSecret: {} # name: "" # key: "" - # will render queryConfig + # render queryConfig secret data and configure it to be used by Thanos Ruler custom resource, ignored when queryConfig.existingSecret is set # https://thanos.io/tip/components/rule.md/#query-api secret: {} # - http_config: