chart: PVC whenDeleted=Delete (no more leaked pgdata on instance delete)

This commit is contained in:
2026-04-27 12:39:09 +00:00
parent f46e453ed0
commit 88d855d92e

View File

@@ -7,6 +7,17 @@ metadata:
spec: spec:
serviceName: {{ include "instance.fullname" . }}-pg serviceName: {{ include "instance.fullname" . }}-pg
replicas: 1 replicas: 1
# When the StatefulSet is deleted (e.g. ArgoCD prunes the
# Application after an instance is deleted from Tower), drop the
# PVCs too. Without this, K8s preserves the PVC for "data safety"
# — but in v3's model an instance delete IS a clean wipe, and
# leaking the PVC means a same-named recreate mounts the old PG
# data dir whose pg_authid carries the previous password. db-init
# then fails password auth even though the new K8s Secret has the
# correct hash. Setting Delete here prevents that whole class.
persistentVolumeClaimRetentionPolicy:
whenDeleted: Delete
whenScaled: Retain
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/instance: {{ .Values.instance.code | quote }} app.kubernetes.io/instance: {{ .Values.instance.code | quote }}