Skip to content

Commit

Permalink
Add persistence.existingClaim (bokysan#57)
Browse files Browse the repository at this point in the history
This commit enables the user to provide an existing volume claim instead of having the image create a new one automatically.
  • Loading branch information
bcroq authored Feb 8, 2021
1 parent cf2b2be commit 8354e6c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ Chart configuration is as follows:
| `config.opendkim` | `{}` | Key-value list of general OpenDKIM options, e.g. `RequireSafeKeys: "yes"` |
| `persistence.enabled` | `true` | Persist Postfix's queu on disk |
| `persistence.accessModes` | `[ 'ReadWriteOnce' ]` | Access mode |
| `persistence.existingClaim` | `""` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. |
| `persistence.size` | `1Gi` | Storage size |
| `persistence.storageClass` | `""` | Storage class |
Expand Down
10 changes: 9 additions & 1 deletion helm/mail/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,21 @@ spec:
resources: {{ toYaml .Values.resources | nindent 12 }}
{{- if .Values.persistence.enabled }}
{{ if .Values.extraVolumes }}volumes: {{- toYaml .Values.extraVolumes | nindent 8 }}{{ end }}
{{- if .Values.persistence.existingClaim }}
volumes:
- name: {{ $fullName }}
persistentVolumeClaim:
{{- with .Values.persistence.existingClaim }}
claimName: {{ tpl . $ }}
{{- end }}
{{- else }}
volumes:
- name: {{ $fullName }}
emptyDir: {}
{{- if .Values.extraVolumes }}{{- toYaml .Values.extraVolumes | nindent 8 }}{{ end }}
{{- end }}
{{- if .Values.persistence.enabled }}
{{- end }}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
volumeClaimTemplates:
- metadata:
name: {{ $fullName }}
Expand Down
1 change: 1 addition & 0 deletions helm/mail/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,6 @@ persistence:
enabled: true
accessModes:
- ReadWriteOnce
existingClaim: ""
size: 1Gi
storageClass: ""

0 comments on commit 8354e6c

Please sign in to comment.