feat: add pvc

This commit is contained in:
Loïc Kalbermatter 2024-06-10 11:46:41 +02:00
parent ed29037cb0
commit d42034c55f
Signed by: PulseDev
GPG Key ID: 0516267FEC58F5F3
5 changed files with 47 additions and 18 deletions

View File

@ -3,7 +3,7 @@ name: stalwart-mail
description: Helm Chart for Stalwart Mail Server - Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP) description: Helm Chart for Stalwart Mail Server - Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP)
icon: https://stalw.art/home/apple-touch-icon.png icon: https://stalw.art/home/apple-touch-icon.png
type: application type: application
version: 0.0.3 version: 0.0.5
# renovate: image=docker.io/stalwartlabs/mail-server # renovate: image=docker.io/stalwartlabs/mail-server
appVersion: '0.8.1' appVersion: '0.8.1'
maintainers: maintainers:

View File

@ -1,6 +1,6 @@
# stalwart-mail # stalwart-mail
![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.1](https://img.shields.io/badge/AppVersion-0.8.1-informational?style=flat-square) ![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.1](https://img.shields.io/badge/AppVersion-0.8.1-informational?style=flat-square)
Helm Chart for Stalwart Mail Server - Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP) Helm Chart for Stalwart Mail Server - Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP)
@ -18,10 +18,11 @@ Helm Chart for Stalwart Mail Server - Secure & Modern All-in-One Mail Server (IM
| image.repository | string | `"stalwartlabs/mail-server"` | | | image.repository | string | `"stalwartlabs/mail-server"` | |
| image.tag | string | `""` | | | image.tag | string | `""` | |
| persistence.accessMode | string | `"ReadWriteOnce"` | | | persistence.accessMode | string | `"ReadWriteOnce"` | |
| persistence.enabled | bool | `true` | | | persistence.enabled | bool | `false` | |
| persistence.existingClaim | string | `""` | |
| persistence.mountPath | string | `"/opt/stalwart-mail"` | | | persistence.mountPath | string | `"/opt/stalwart-mail"` | |
| persistence.size | string | `"10Gi"` | | | persistence.size | string | `"10Gi"` | |
| persistence.storageClass | string | `"standard"` | | | persistence.storageClass | string | `""` | |
| replicaCount | int | `1` | | | replicaCount | int | `1` | |
| service.ports.http | int | `8080` | | | service.ports.http | int | `8080` | |
| service.ports.https | int | `443` | | | service.ports.https | int | `443` | |

View File

@ -1,23 +1,20 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "stalwart-mail.fullname" . }} name: { { include "stalwart-mail.fullname" . } }
labels: labels: { { - include "stalwart-mail.labels" . | nindent 4 } }
{{- include "stalwart-mail.labels" . | nindent 4 }}
spec: spec:
replicas: {{ .Values.replicaCount }} replicas: { { .Values.replicaCount } }
selector: selector:
matchLabels: matchLabels: { { - include "stalwart-mail.selectorLabels" . | nindent 6 } }
{{- include "stalwart-mail.selectorLabels" . | nindent 6 }}
template: template:
metadata: metadata:
labels: labels: { { - include "stalwart-mail.selectorLabels" . | nindent 8 } }
{{- include "stalwart-mail.selectorLabels" . | nindent 8 }}
spec: spec:
containers: containers:
- name: stalwart-mail - name: stalwart-mail
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" image: '{{ .Values.image.repository }}:{{ .Values.image.tag }}'
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: { { .Values.image.pullPolicy } }
ports: ports:
- containerPort: 8080 - containerPort: 8080
- containerPort: 443 - containerPort: 443
@ -29,8 +26,8 @@ spec:
- containerPort: 4190 - containerPort: 4190
volumeMounts: volumeMounts:
- name: stalwart-volume - name: stalwart-volume
mountPath: {{ .Values.persistence.mountPath }} mountPath: { { .Values.persistence.mountPath } }
volumes: volumes:
- name: stalwart-volume - name: stalwart-volume
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ include "stalwart-mail.fullname" . }} claimName: { { .Values.persistence.existingClaim | default (include "stalwart-mail.fullname" .) } }

22
templates/pvc.yaml Normal file
View File

@ -0,0 +1,22 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "stalwart-mail.fullname" . }}
labels:
{{- include "stalwart-mail.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if not .Values.persistence.storageClass }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.persistence.storageClass | quote }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -15,9 +15,18 @@ service:
imaps: 993 imaps: 993
sieve: 4190 sieve: 4190
## Persist configuration to a persistent volume
persistence: persistence:
enabled: true # persistence.enabled - Should disk persistence be enabled
storageClass: 'standard' enabled: false
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
existingClaim: ''
storageClass: ''
accessMode: ReadWriteOnce accessMode: ReadWriteOnce
size: 10Gi size: 10Gi
mountPath: /opt/stalwart-mail mountPath: /opt/stalwart-mail