From 70aa37539496128f1ed07d97e29edbabcc8ded10 Mon Sep 17 00:00:00 2001 From: thameezb Date: Wed, 11 Oct 2023 11:06:19 +0200 Subject: [PATCH] fix: kube-prom-stack thanos-ruler alertmanagerConfigs (#3870) Signed-off-by: ThameezBo Signed-off-by: Quentin Bisson Co-authored-by: Quentin Bisson --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/thanos-ruler/ruler.yaml | 3 ++- .../templates/thanos-ruler/secret.yaml | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index bc1f2dd2e390..aa1373b9d8f5 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 51.5.1 +version: 51.5.2 appVersion: v0.68.0 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 505d68b025d8..6d8c12a93aa6 100644 --- a/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml +++ b/charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml @@ -73,7 +73,8 @@ spec: {{- end }} {{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig }} alertmanagersConfig: -{{ toYaml .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig | indent 4 }} + key: alertmanager-configs.yaml + name: {{ template "kube-prometheus-stack.thanosRuler.name" . }} {{- end }} {{- if .Values.thanosRuler.thanosRulerSpec.queryEndpoints }} queryEndpoints: diff --git a/charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml b/charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml new file mode 100644 index 000000000000..ede29be714cd --- /dev/null +++ b/charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml @@ -0,0 +1,14 @@ +{{- if .Values.thanosRuler.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "kube-prometheus-stack.thanosRuler.name" . }} + namespace: {{ template "kube-prometheus-stack.namespace" . }} + labels: + app: {{ include "kube-prometheus-stack.thanosRuler.name" . }} +{{ include "kube-prometheus-stack.labels" . | indent 4 }} +data: +{{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig }} + alertmanager-configs.yaml: {{ toYaml .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig | b64enc | quote }} +{{- end }} +{{- end }}