{{- /* TWO claims, and the split is the durability design of this chart rather than a sizing convenience (Gitea #81): 1. -garage-pvc metadata_dir AND data_dir, as two subdirectories of this one volume 2. -garage-snapshots-pvc metadata_snapshots_dir Claim 1 keeps index and blocks on ONE volume because Longhorn snapshots are atomic per volume and never across volumes. Split over two volumes, a backup can capture metadata that points at objects whose blocks were not written yet - for a mail store exactly the failure "the mailbox lists a message whose body is missing". Claim 2 exists because Garage's own metadata snapshots are the only consistent recovery point here (file-system snapshots of a live metadata database are not one), and a recovery point stored on the volume whose corruption it should repair is not a recovery point. Both blocks are DELIBERATELY NOT null-safe: an erased size yields an invalid PVC that is rejected at apply time, which is loud. A chart-side fallback would silently size somebody's object store - and on an existing release it could not help anyway, because a PVC cannot shrink. Same reasoning as satisfactory's documented exception (Gitea #39) and valkey's persistence block. Neither claim is ever renamed: a renamed PVC makes Kubernetes provision a new, empty volume and orphans the data. */ -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-pvc labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs spec: accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.storage.data.amount }} {{- if .Values.storage.data.storageClass }} storageClassName: {{ .Values.storage.data.storageClass }} {{- end }} --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-snapshots-pvc labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs spec: accessModes: - ReadWriteOnce resources: requests: # Sized for TWO snapshots of the metadata database plus head room, not # for the objects - Garage keeps exactly two and deletes the older ones # itself. A snapshot is a compacted copy of the LMDB file, so this needs # roughly twice the size metadata_dir reaches. storage: {{ .Values.storage.snapshots.amount }} {{- if .Values.storage.snapshots.storageClass }} storageClassName: {{ .Values.storage.snapshots.storageClass }} {{- end }}