From e231c419c4186f6afce17a5dd8fa4a2976c9b91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Ahlers?= Date: Mon, 10 Mar 2025 12:54:27 +0100 Subject: [PATCH] make uploads persistent --- templates/deployment.yaml | 24 ++++++++++++++++++------ values.yaml | 3 ++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index cbceac3..f3795c1 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -54,11 +54,16 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: - - name: storage + - name: config mountPath: "/config/" {{- if .Values.persistence.subPath }} subPath: {{ .Values.persistence.subPath }} {{- end }} + - name: uploads + mountPath: "/var/www/html/uploads" + {{- if .Values.persistence.subPath }} + subPath: {{ .Values.persistence.subPath }} + {{- end }} env: - name: LB_DB_HOST {{- if eq .Values.mariadb.enabled true }} @@ -110,13 +115,20 @@ spec: - name: TZ value: '{{ .Values.librebooking.TZ }}' volumes: - - name: storage - {{- if .Values.persistence.enabled }} + - name: uploads + {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ .Values.persistence.existingClaim | default (include "librebooking.fullname" .) }} - {{- else }} + claimName: {{ .Values.persistence.existingClaimUploads | default (printf "%s-uploads" (include "librebooking.fullname" .))}} + {{- else }} emptyDir: {} - {{- end -}} + {{- end }} + - name: config + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaimConfig | default (printf "%s-config" (include "librebooking.fullname" .)) }} + {{- else }} + emptyDir: {} + {{- end }} {{- range .Values.librebooking.extraVolumeMounts }} - name: {{ .name }} {{- if .existingClaim }} diff --git a/values.yaml b/values.yaml index d21154f..cb6aa55 100644 --- a/values.yaml +++ b/values.yaml @@ -178,7 +178,8 @@ persistence: - kubernetes.io/pvc-protection selectorLabels: {} subPath: "" - existingClaim: null + existingClaimConfig: null + existingClaimUploads: null # This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ autoscaling: