From fad5ae8341221777273dad9f4818e1731bba0c6c Mon Sep 17 00:00:00 2001 From: shahargl Date: Fri, 29 Nov 2024 12:57:50 +0100 Subject: [PATCH] feat: retain --- charts/keep/Chart.yaml | 2 +- charts/keep/templates/db-pvc.yaml | 8 ++++++-- charts/keep/values.yaml | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/charts/keep/Chart.yaml b/charts/keep/Chart.yaml index e96e13a..deef42d 100644 --- a/charts/keep/Chart.yaml +++ b/charts/keep/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: keep -version: 0.1.43 +version: 0.1.44 description: Keep Helm Chart type: application icon: https://platform.keephq.dev/_next/image?url=%2Fkeep.png&w=48&q=75 diff --git a/charts/keep/templates/db-pvc.yaml b/charts/keep/templates/db-pvc.yaml index 0c5b2dd..dc567ca 100644 --- a/charts/keep/templates/db-pvc.yaml +++ b/charts/keep/templates/db-pvc.yaml @@ -6,14 +6,18 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ $pvcName }} + annotations: + {{- if .Values.database.pvc.retain }} + helm.sh/resource-policy: keep + {{- end }} spec: - accessModes: - - ReadWriteOnce {{- if $existingPvc }} # Use existing PVC spec {{- toYaml $existingPvc.spec | nindent 2 }} {{- else }} # Define new PVC spec + accessModes: + - ReadWriteOnce {{- if .Values.database.pvc.storageClass }} storageClassName: {{ .Values.database.pvc.storageClass }} {{- end }} diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index ad70f0c..60a01a6 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -265,6 +265,7 @@ database: enabled: true size: 5Gi storageClass: "" + retain: false image: repository: mysql pullPolicy: IfNotPresent