apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "snappymail.fullname" . }} namespace: {{ .Values.namespace }} labels: {{- include "snappymail.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "snappymail.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "snappymail.selectorLabels" . | nindent 8 }} spec: securityContext: {{- toYaml .Values.securityContext | nindent 8 }} containers: - name: snappymail image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.service.targetPort }} protocol: TCP volumeMounts: - name: data mountPath: {{ .Values.persistence.mountPath }} resources: {{- toYaml .Values.resources | nindent 10 }} livenessProbe: httpGet: path: / port: http initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: / port: http initialDelaySeconds: 10 periodSeconds: 5 {{- with .Values.env }} env: {{- toYaml . | nindent 10 }} {{- end }} volumes: {{- if .Values.persistence.enabled }} - name: data persistentVolumeClaim: claimName: {{ include "snappymail.fullname" . }} {{- else }} - name: data emptyDir: {} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}