diff --git a/charts/operator/templates/alertmanager.yaml b/charts/operator/templates/alertmanager.yaml index 78c646b214..5c2a240c9b 100644 --- a/charts/operator/templates/alertmanager.yaml +++ b/charts/operator/templates/alertmanager.yaml @@ -137,7 +137,12 @@ spec: secret: secretName: alertmanager - name: alertmanager-data + {{- if .Values.alertManager.persistence.enabled }} + persistentVolumeClaim: + claimName: alertmanager-data + {{- else }} emptyDir: {} + {{- end }} - name: alertmanager-config emptyDir: {} affinity: @@ -170,3 +175,23 @@ spec: seccompProfile: type: RuntimeDefault serviceName: alertmanager +{{- if .Values.alertManager.persistence.enabled }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: alertmanager-data +spec: + accessModes: + {{- toYaml .Values.alertManager.persistence.accessModes | nindent 4 }} + resources: + requests: + storage: {{ .Values.alertManager.persistence.size }} + {{- if .Values.alertManager.persistence.storageClass }} + {{- if (eq "none" .Values.alertManager.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.alertManager.persistence.storageClass }}" + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/values.global.yaml b/charts/values.global.yaml index 8a939826e6..9285ccf4f1 100644 --- a/charts/values.global.yaml +++ b/charts/values.global.yaml @@ -101,3 +101,12 @@ ruleEvaluator: serviceAccount: create: true name: rule-evaluator +alertManager: + persistence: + enabled: false + ## Define the storageClassName for the PVC for dynamic provisioning. + ## if set to "none" the PVC will be created without a storage class and use the default storage class if one is specified by cluster administrators. + storageClass: "none" + size: 50Mi + accessModes: + - ReadWriteOnce