Skip to content

Commit

Permalink
[prometheus] Add option to set --storage.tsdb.path (prometheus-commun…
Browse files Browse the repository at this point in the history
…ity#986)

Previously the value of '--storage.tsdb.path' was set via '.Values.server.persistentVolume.mountPath'.
This commit adds the option to specify a 'server.hostPath' value. When
the 'server.hostPath' value is not empty, the 'server.hostPath' value is
used for '--storage.tsdb.path' instead.

Signed-off-by: Vincent Van Ouytsel <[email protected]>
  • Loading branch information
vvanouytsel authored May 21, 2021
1 parent cf8b1ee commit 1935b57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/prometheus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: prometheus
appVersion: 2.26.0
version: 14.0.1
version: 14.1.0
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
Expand Down
4 changes: 4 additions & 0 deletions charts/prometheus/templates/server/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,10 @@ server:
## Path to a configuration file on prometheus server container FS
configPath: /etc/config/prometheus.yml

### The data directory used by prometheus to set --storage.tsdb.path
### When empty server.persistentVolume.mountPath is used instead
storagePath: ""

global:
## How frequently to scrape targets by default
##
Expand Down

0 comments on commit 1935b57

Please sign in to comment.