From 2343a0f67469623c2802ff1901f3f60527f9187e Mon Sep 17 00:00:00 2001 From: Jack Henschel Date: Sat, 29 May 2021 12:17:43 +0300 Subject: [PATCH] [prometheus] Respect storagePath value when deployed as StatefulSet (#1003) As discussed in https://github.com/prometheus-community/helm-charts/issues/1002 the StatefulSet deploy option of Prometheus server previously ignored the server.storagePath Helm value. This patch fixes that behavior. Signed-off-by: Jack Henschel --- charts/prometheus/Chart.yaml | 2 +- charts/prometheus/templates/server/sts.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/prometheus/Chart.yaml b/charts/prometheus/Chart.yaml index 2df67a0b..3e7aaf1e 100644 --- a/charts/prometheus/Chart.yaml +++ b/charts/prometheus/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus appVersion: 2.26.0 -version: 14.1.0 +version: 14.1.1 description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png diff --git a/charts/prometheus/templates/server/sts.yaml b/charts/prometheus/templates/server/sts.yaml index 83b02232..00c3557f 100644 --- a/charts/prometheus/templates/server/sts.yaml +++ b/charts/prometheus/templates/server/sts.yaml @@ -90,7 +90,11 @@ spec: - --storage.tsdb.retention.time={{ .Values.server.retention }} {{- end }} - --config.file={{ .Values.server.configPath }} + {{- if .Values.server.storagePath }} + - --storage.tsdb.path={{ .Values.server.storagePath }} + {{- else }} - --storage.tsdb.path={{ .Values.server.persistentVolume.mountPath }} + {{- end }} - --web.console.libraries=/etc/prometheus/console_libraries - --web.console.templates=/etc/prometheus/consoles {{- range .Values.server.extraFlags }}