Add persistence.existingClaim support

#75 · closed · 1 comments

View on GitHub ↗

maruina

## Summary Add `existingClaim` support to the persistence configuration, following the standard Helm chart convention (bitnami, etc.). When `persistence.existingClaim` is set, the chart should skip PVC creation and mount the user-provided PVC name instead. ## Motivation In maruina/malazan.xyz#604, all PVCs are being migrated to named storage classes with deterministic paths for cluster rebuild resilience. The current chart always creates its own PVC, which makes migration awkward — requires deleting the Helm-managed PVC and fighting Helm's release state. With `existingClaim`, the migration becomes a clean values change: 1. Create a standalone PVC on the desired storage class 2. Set `persistence.existingClaim: <pvc-name>` in values 3. Helm drops its PVC template and mounts the external one ## Implementation Guard the PVC template with: ```yaml {{- if not .Values.persistence.existingClaim }} # existing PVC template {{- end }} ``` And in the volume mount: ```yaml claimName: {{ .Values.persistence.existingClaim | default (printf "%s" (include "chart.fullname" .)) }} ``` Add `existingClaim: ""` to `values.yaml` under `persistence`. ## Acceptance Criteria - [ ] `persistence.existingClaim` accepted as a values parameter - [ ] When set, no PVC is created by the chart - [ ] When unset, behavior is unchanged (chart creates PVC as before) - [ ] Bump chart version

Comments

maruina

Already implemented — `persistence.existingClaim` is supported in the current chart (v0.2.0). PVC template is guarded with `{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}` and the deployment resolves the claim name via the `pvcName` helper. No changes needed.