-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add storage for Prometheus using a PersistentVolumeClaim
Prior to this change, Prometheus' timeseries data would be lost whenever the chart was upgraded, the Prometheus Pod was rescheduled, or restarted due to a configuration change. Tested with a blank storageClassName with KinD, and the local path provisioner. After creating load with hey, and restarting Prometheus, the invocation metrics remained available. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
- Loading branch information
Showing
3 changed files
with
74 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- $functionNs := default .Release.Namespace .Values.functionNamespace }} | ||
{{- if and .Values.prometheus.create .Values.prometheus.pvc.enabled }} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
labels: | ||
app: {{ template "openfaas.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
component: prometheus | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
{{- if .Values.prometheus.pvc.name }} | ||
name: {{.Values.prometheus.pvc.name}} | ||
{{- else }} | ||
name: prometheus-data | ||
{{- end }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ .Values.prometheus.pvc.size | quote }} | ||
{{- with .Values.prometheus.pvc.storageClassName }} | ||
storageClassName: {{ . | quote }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters