-
Notifications
You must be signed in to change notification settings - Fork 474
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. The name of the pvc can also be set, however this is not documented in values.yaml, this may be required for multiple installations of OpenFaaS within the same cluster for testing purposes. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
- Loading branch information
Showing
4 changed files
with
81 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
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,30 @@ | ||
{{- $functionNs := default .Release.Namespace .Values.functionNamespace }} | ||
{{- if .Values.openfaasPro }} | ||
{{- 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 }} | ||
{{- 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