@@ -13,7 +13,12 @@ metadata:
1313 annotations : {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1414 {{- end }}
1515spec :
16+ {{- if eq .Values.postfix.kind "StatefulSet" }}
17+ replicas : {{ .Values.postfix.replicaCount }}
18+ podManagementPolicy : " Parallel"
19+ {{- else }}
1620 replicas : 1
21+ {{- end }}
1722 {{- if .Values.postfix.updateStrategy }}
1823 strategy : {{- toYaml .Values.postfix.updateStrategy | nindent 4 }}
1924 {{- end }}
@@ -140,9 +145,11 @@ spec:
140145 - ' ! /usr/libexec/postfix/master -t'
141146 {{- end }}
142147 volumes :
148+ {{- if not eq .Values.postfix.kind "StatefulSet" }}
143149 - name : data
144150 persistentVolumeClaim :
145151 claimName : {{ include "mailu.postfix.claimName" . }}
152+ {{- end }}
146153 {{- if .Values.postfix.overrides }}
147154 - name : overrides
148155 configMap :
@@ -151,3 +158,40 @@ spec:
151158 {{- if .Values.postfix.extraVolumes }}
152159 {{- include "common.tplvalues.render" (dict "value" .Values.postfix.extraVolumes "context" $) | nindent 8 }}
153160 {{- end }}
161+ {{- if eq .Values.postfix.kind "StatefulSet" }}
162+ volumeClaimTemplates :
163+ - metadata :
164+ name : data
165+ labels : {{- include "common.labels.standard" . | nindent 10 }}
166+ app.kubernetes.io/component : postfix
167+ {{- if .Values.postfix.persistence.labels }}
168+ {{- include "common.tplvalues.render" ( dict "value" .Values.postfix.persistence.labels "context" $ ) | nindent 10 }}
169+ {{- end }}
170+ {{- if .Values.commonLabels }}
171+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 10 }}
172+ {{- end }}
173+ {{- if or .Values.postfix.persistence.annotations .Values.commonAnnotations }}
174+ annotations :
175+ {{- if .Values.postfix.persistence.annotations }}
176+ {{- include "common.tplvalues.render" ( dict "value" .Values.postfix.persistence.annotations "context" $ ) | nindent 10 }}
177+ {{- end }}
178+ {{- if .Values.commonAnnotations }}
179+ {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 10 }}
180+ {{- end }}
181+ {{- end }}
182+ spec :
183+ accessModes :
184+ {{- range .Values.postfix.persistence.accessModes }}
185+ - {{ . | quote }}
186+ {{- end }}
187+ resources :
188+ requests :
189+ storage : {{ .Values.postfix.persistence.size | quote }}
190+ {{- if .Values.postfix.persistence.selector }}
191+ selector : {{- include "common.tplvalues.render" (dict "value" .Values.postfix.persistence.selector "context" $) | nindent 10 }}
192+ {{- end }}
193+ {{- if .Values.postfix.persistence.dataSource }}
194+ dataSource : {{- include "common.tplvalues.render" (dict "value" .Values.postfix.persistence.dataSource "context" $) | nindent 10 }}
195+ {{- end }}
196+ {{- include "common.storage.class" (dict "persistence" .Values.postfix.persistence "global" .Values.global) | nindent 8 }}
197+ {{- end }}
0 commit comments