diff --git a/templates/backend-pvc.yaml b/templates/backend-pvc.yaml new file mode 100644 index 0000000..0a1327c --- /dev/null +++ b/templates/backend-pvc.yaml @@ -0,0 +1,30 @@ +{{- if .Values.backend.enabled -}} +{{- if .Values.backend.persistence.enabled -}} +# tower-data — small PVC backing the OpStore JSON snapshot so the +# notification bell + Activity history survive tower-backend pod +# restarts (rollouts, OOMs, node drain). 200 ops × ~2 KB each = +# ~400 KB at full retention; 1 GiB is plenty of headroom and lets us +# add other Tower-side state files later (cache, audit log, etc.) +# without re-provisioning. +# +# Single-replica RWO is fine because tower-backend Deployment is +# single-replica (no leader election yet). When we move to multi- +# replica or HA Tower, replace with RWX or move state to Postgres. +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: tower-data + labels: + {{- include "tower.labels" . | nindent 4 }} + odoosky.io/role: backend +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.backend.persistence.size | default "1Gi" }} + {{- with .Values.backend.persistence.storageClass }} + storageClassName: {{ . | quote }} + {{- end }} +{{- end }} +{{- end }}