diff --git a/templates/pvc.yaml b/templates/pvc.yaml index b5ef6af..924de44 100644 --- a/templates/pvc.yaml +++ b/templates/pvc.yaml @@ -2,29 +2,60 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ template "librebooking.fullname" . }} + name: {{ (printf "%s-uploads" (include "librebooking.fullname" .)) }} labels: {{- include "librebooking.labels" . | nindent 4 }} - {{- with .Values.persistence.annotations }} + {{- with .Values.persistence.uploads.annotations }} annotations: {{ toYaml . | indent 4 }} {{- end }} - {{- with .Values.persistence.finalizers }} + {{- with .Values.persistence.uploads.finalizers }} finalizers: {{ toYaml . | indent 4 }} {{- end }} spec: accessModes: - {{- range .Values.persistence.accessModes }} + {{- range .Values.persistence.uploads.accessModes }} - {{ . | quote }} {{- end }} resources: requests: - storage: {{ .Values.persistence.size | quote }} - {{- if .Values.persistence.storageClassName }} - storageClassName: {{ .Values.persistence.storageClassName }} + storage: {{ .Values.persistence.uploads.size | quote }} + {{- if .Values.persistence.uploads.storageClassName }} + storageClassName: {{ .Values.persistence.uploads.storageClassName }} {{- end -}} - {{- with .Values.persistence.selectorLabels }} + {{- with .Values.persistence.uploads.selectorLabels }} + selector: + matchLabels: +{{ toYaml . | indent 6 }} + {{- end }} +--- + apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ (printf "%s-config" (include "librebooking.fullname" .)) }} + labels: + {{- include "librebooking.labels" . | nindent 4 }} + {{- with .Values.persistence.config.annotations }} + annotations: +{{ toYaml . | indent 4 }} + {{- end }} + {{- with .Values.persistence.config.finalizers }} + finalizers: +{{ toYaml . | indent 4 }} + {{- end }} +spec: + accessModes: + {{- range .Values.persistence.config.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.config.size | quote }} + {{- if .Values.persistence.config.storageClassName }} + storageClassName: {{ .Values.persistence.config.storageClassName }} + {{- end -}} + {{- with .Values.persistence.config.selectorLabels }} selector: matchLabels: {{ toYaml . | indent 6 }} diff --git a/values.yaml b/values.yaml index cb6aa55..d95af97 100644 --- a/values.yaml +++ b/values.yaml @@ -169,17 +169,28 @@ readinessProbe: persistence: # Enable persistence with PVC. If false, uses emptyDir instead. enabled: true - storageClassName: longhorn - accessModes: - - ReadWriteOnce - size: 10Gi - annotations: {} - finalizers: - - kubernetes.io/pvc-protection - selectorLabels: {} - subPath: "" - existingClaimConfig: null - existingClaimUploads: null + config: + storageClassName: longhorn + accessModes: + - ReadWriteOnce + size: 1Gi + annotations: {} + finalizers: + - kubernetes.io/pvc-protection + selectorLabels: {} + subPath: "" + existingClaim: null + uploads: + storageClassName: longhorn + accessModes: + - ReadWriteOnce + size: 10Gi + annotations: {} + finalizers: + - kubernetes.io/pvc-protection + selectorLabels: {} + subPath: "" + existingClaim: null # This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ autoscaling: