Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add existingClaim option to the individual pods #372

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions .github/workflows/publish-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify-matrix:
needs:
- publish
runs-on: ubuntu-latest
name: Send message via Matrix
steps:
- name: Send message to mailu-helm-chart channel
# Only run this job if the release-please job created a release
id: matrix-chat-message
uses: fadenb/[email protected]
with:
homeserver: "matrix.org"
token: ${{ secrets.MATRIX_TOKEN }}
channel: "!KluZWhQwHDYrOfqJdD:make-it.fr"
message: |
# New release of ${{ github.event.inputs.package }} helm chart: ${{ github.event.inputs.version }}

[${{ github.event.inputs.version }}](https://github.com/${{ github.repository }}/releases/tag/${{ github.event.inputs.package }}-${{ github.event.inputs.version }}) has been released.

${{ needs.publish.outputs.release_body }}

70 changes: 63 additions & 7 deletions mailu/templates/_claims.tpl
Original file line number Diff line number Diff line change
@@ -1,34 +1,90 @@
{{/* Admin pod persistent volume claim name */}}
{{ define "mailu.admin.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.admin.persistence.claimNameOverride | default (printf "%s-admin" (include "mailu.fullname" .)) -}}
{{- if .Values.persistence.single_pvc -}}
{{- (include "mailu.claimName" .) -}}
{{- else if .Values.admin.persistence.existingClaim -}}
{{- .Values.admin.persistence.existingClaim -}}
{{- else if .Values.admin.persistence.claimNameOverride -}}
{{- .Values.admin.persistence.claimNameOverride -}}
{{- else -}}
{{ printf "%s-admin" (include "mailu.fullname" .) }}
{{- end -}}
{{- end -}}

{{/* Dovecot pod persistent volume claim name */}}
{{ define "mailu.dovecot.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.dovecot.persistence.claimNameOverride | default (printf "%s-dovecot" (include "mailu.fullname" .)) -}}
{{- if .Values.persistence.single_pvc -}}
{{- (include "mailu.claimName" .) -}}
{{- else if .Values.dovecot.persistence.existingClaim -}}
{{- .Values.dovecot.persistence.existingClaim -}}
{{- else if .Values.dovecot.persistence.claimNameOverride -}}
{{- .Values.dovecot.persistence.claimNameOverride -}}
{{- else -}}
{{ printf "%s-dovecot" (include "mailu.fullname" .) }}
{{- end -}}
{{- end -}}

{{/* Postfix pod persistent volume claim name */}}
{{ define "mailu.postfix.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.postfix.persistence.claimNameOverride | default (printf "%s-postfix" (include "mailu.fullname" .)) -}}
{{- if .Values.persistence.single_pvc -}}
{{- (include "mailu.claimName" .) -}}
{{- else if .Values.postfix.persistence.existingClaim -}}
{{- .Values.postfix.persistence.existingClaim -}}
{{- else if .Values.postfix.persistence.claimNameOverride -}}
{{- .Values.postfix.persistence.claimNameOverride -}}
{{- else -}}
{{ printf "%s-postfix" (include "mailu.fullname" .) }}
{{- end -}}
{{- end -}}

{{/* Rspamd pod persistent volume claim name */}}
{{ define "mailu.rspamd.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.rspamd.persistence.claimNameOverride | default (printf "%s-rspamd" (include "mailu.fullname" .)) -}}
{{- if .Values.persistence.single_pvc -}}
{{- (include "mailu.claimName" .) -}}
{{- else if .Values.rspamd.persistence.existingClaim -}}
{{- .Values.rspamd.persistence.existingClaim -}}
{{- else if .Values.rspamd.persistence.claimNameOverride -}}
{{- .Values.rspamd.persistence.claimNameOverride -}}
{{- else -}}
{{ printf "%s-rspamd" (include "mailu.fullname" .) }}
{{- end -}}
{{- end -}}

{{/* Roundcube pod persistent volume claim name */}}
{{ define "mailu.webmail.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}}
{{- if .Values.persistence.single_pvc -}}
{{- (include "mailu.claimName" .) -}}
{{- else if .Values.webmail.persistence.existingClaim -}}
{{- .Values.webmail.persistence.existingClaim -}}
{{- else if .Values.webmail.persistence.claimNameOverride -}}
{{- .Values.webmail.persistence.claimNameOverride -}}
{{- else -}}
{{ printf "%s-webmail" (include "mailu.fullname" .) }}
{{- end -}}
{{- end -}}

{{/* Fetchmail pod persistent volume claim name */}}
{{ define "mailu.fetchmail.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.fetchmail.persistence.claimNameOverride | default (printf "%s-fetchmail" (include "mailu.fullname" .)) -}}
{{- if .Values.persistence.single_pvc -}}
{{- (include "mailu.claimName" .) -}}
{{- else if .Values.fetchmail.persistence.existingClaim -}}
{{- .Values.fetchmail.persistence.existingClaim -}}
{{- else if .Values.fetchmail.persistence.claimNameOverride -}}
{{- .Values.fetchmail.persistence.claimNameOverride -}}
{{- else -}}
{{ printf "%s-fetchmail" (include "mailu.fullname" .) }}
{{- end -}}
{{- end -}}

{{/* Webdav pod persistent volume claim name */}}
{{ define "mailu.webdav.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webdav.persistence.claimNameOverride | default (printf "%s-webdav" (include "mailu.fullname" .)) -}}
{{- if .Values.persistence.single_pvc -}}
{{- (include "mailu.claimName" .) -}}
{{- else if .Values.webdav.persistence.existingClaim -}}
{{- .Values.webdav.persistence.existingClaim -}}
{{- else if .Values.webdav.persistence.claimNameOverride -}}
{{- .Values.webdav.persistence.claimNameOverride -}}
{{- else -}}
{{ printf "%s-webdav" (include "mailu.fullname" .) }}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion mailu/templates/admin/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
{{- if not .Values.persistence.single_pvc }}
{{- if and (not .Values.persistence.single_pvc) (not .Values.admin.persistence.existingClaim)}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down
2 changes: 1 addition & 1 deletion mailu/templates/dovecot/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
{{- if .Values.dovecot.enabled }}
{{- if not .Values.persistence.single_pvc }}
{{- if and (not .Values.persistence.single_pvc) (not .Values.postfix.persistence.existingClaim)}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down
4 changes: 3 additions & 1 deletion mailu/templates/fetchmail/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
{{- if and (.Values.fetchmail.enabled) (not .Values.persistence.single_pvc) }}
{{- if .Values.fetchmail.enabled -}}
{{- if and (not .Values.persistence.single_pvc) (not .Values.fetchmail.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down Expand Up @@ -31,3 +32,4 @@ spec:
storageClassName: {{ .Values.fetchmail.persistence.storageClass }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion mailu/templates/postfix/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
{{- if not .Values.persistence.single_pvc }}
{{- if and (not .Values.persistence.single_pvc) (not .Values.postfix.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down
4 changes: 3 additions & 1 deletion mailu/templates/rspamd/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
{{- if and (not .Values.persistence.single_pvc) .Values.rspamd.enabled }}
{{- if .Values.rspamd.enabled -}}
{{- if and (not .Values.persistence.single_pvc) (not .Values.rspamd.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down Expand Up @@ -31,3 +32,4 @@ spec:
storageClassName: {{ .Values.rspamd.persistence.storageClass }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion mailu/templates/webdav/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
{{- if and (.Values.webdav.enabled) (not .Values.persistence.single_pvc) }}
{{- if .Values.webdav.enabled -}}
{{- if and (not .Values.persistence.single_pvc) (not .Values.webdav.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down Expand Up @@ -31,3 +32,4 @@ spec:
storageClassName: {{ .Values.webdav.persistence.storageClass }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion mailu/templates/webmail/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
{{- if and (.Values.webmail.enabled) (not .Values.persistence.single_pvc) }}
{{- if .Values.webmail.enabled -}}
{{- if and (not .Values.persistence.single_pvc) (not .Values.webmail.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down Expand Up @@ -31,3 +32,4 @@ spec:
storageClassName: {{ .Values.webmail.persistence.storageClass }}
{{- end }}
{{- end }}
{{- end }}