From d8d46266dc0d4c25ec9a924690e843daacc79b0c Mon Sep 17 00:00:00 2001 From: Oleg Lukasonok Date: Fri, 6 Nov 2026 21:23:49 +0200 Subject: [PATCH] Chart: postgresql.existingClaim for a database volume made outside the chart --- README.md | 2 +- charts/archify-sync/Chart.yaml | 2 +- charts/archify-sync/templates/postgresql.yaml | 7 +++++++ charts/archify-sync/values.yaml | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 54e7025..a0e755f 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ helm install sync charts/archify-sync -n archify-sync --create-namespace \ --set database.existingSecret=archify-sync-db # a Secret with the URL under "url" ``` -`postgresql.enabled=true` adds a single PostgreSQL to the release, for trying out. Behind ingress-nginx, raise `proxy-read-timeout` and `proxy-send-timeout` (see `values.yaml`): edits travel over a WebSocket that stays open. +`postgresql.enabled=true` adds a single PostgreSQL to the release, for trying out. `postgresql.existingClaim` puts its data on a claim made outside the chart; PostgreSQL runs as uid 70 and needs that directory owned by 70, mode 0700, so an NFS share must not map every user to root. Behind ingress-nginx, raise `proxy-read-timeout` and `proxy-send-timeout` (see `values.yaml`): edits travel over a WebSocket that stays open. On a local cluster (OrbStack, kind, k3d) with the image from `docker build -t archify-sync:local .`: diff --git a/charts/archify-sync/Chart.yaml b/charts/archify-sync/Chart.yaml index d1a3413..c8b519b 100644 --- a/charts/archify-sync/Chart.yaml +++ b/charts/archify-sync/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: archify-sync description: Archify Sync, live and shared Archify models for VS Code type: application -version: 0.1.0 +version: 0.1.1 appVersion: "0.1.0" annotations: artifacthub.io/license: MIT diff --git a/charts/archify-sync/templates/postgresql.yaml b/charts/archify-sync/templates/postgresql.yaml index ae75544..b8fc646 100644 --- a/charts/archify-sync/templates/postgresql.yaml +++ b/charts/archify-sync/templates/postgresql.yaml @@ -97,6 +97,12 @@ spec: volumes: - name: run emptyDir: {} + {{- with .Values.postgresql.existingClaim }} + - name: data + persistentVolumeClaim: + claimName: {{ . }} + {{- end }} + {{- if not .Values.postgresql.existingClaim }} volumeClaimTemplates: - metadata: name: data @@ -108,4 +114,5 @@ spec: resources: requests: storage: {{ .Values.postgresql.storage }} + {{- end }} {{- end }} diff --git a/charts/archify-sync/values.yaml b/charts/archify-sync/values.yaml index e592df4..603d79b 100644 --- a/charts/archify-sync/values.yaml +++ b/charts/archify-sync/values.yaml @@ -31,6 +31,9 @@ postgresql: existingSecret: "" storage: 5Gi storageClass: "" + # A PersistentVolumeClaim made outside the chart (e.g. a static NFS volume whose + # directory is owned by uid 70, mode 0700); storage and storageClass are then unused. + existingClaim: "" resources: {} config: