From af35e84655022c1c4fb54ce4a62452b6bd4ae72f Mon Sep 17 00:00:00 2001 From: Jason Li Date: Mon, 12 May 2025 04:23:49 +0200 Subject: [PATCH] Set helm resource-policy to be keep (#7574) Modified the chart to retain persistent volumes by default when the chart is uninstalled, following established best practices in the Helm community (e.g., Bitnami charts) ### What problem does this PR solve? Previously, deleting the helm chart would automatically remove all persistent data, which poses a risk of accidental data loss. ### Rationale This change aligns with industry standards to safeguard data by requiring explicit action to remove persistence, rather than making deletion the default behavior. ### Impact: Users who intentionally want to remove persistent data will need to do so manually or by setting appropriate flags during chart uninstallation. ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe): --- helm/templates/elasticsearch.yaml | 2 ++ helm/templates/infinity.yaml | 2 ++ helm/templates/minio.yaml | 2 ++ helm/templates/mysql.yaml | 2 ++ helm/templates/redis.yaml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/helm/templates/elasticsearch.yaml b/helm/templates/elasticsearch.yaml index 935c716bf..9db9c9a8e 100644 --- a/helm/templates/elasticsearch.yaml +++ b/helm/templates/elasticsearch.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ include "ragflow.fullname" . }}-es-data + annotations: + "helm.sh/resource-policy": keep labels: {{- include "ragflow.labels" . | nindent 4 }} app.kubernetes.io/component: elasticsearch diff --git a/helm/templates/infinity.yaml b/helm/templates/infinity.yaml index 8560e7821..6ccdff051 100644 --- a/helm/templates/infinity.yaml +++ b/helm/templates/infinity.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ include "ragflow.fullname" . }}-infinity + annotations: + "helm.sh/resource-policy": keep labels: {{- include "ragflow.labels" . | nindent 4 }} app.kubernetes.io/component: infinity diff --git a/helm/templates/minio.yaml b/helm/templates/minio.yaml index 289007d63..7a5cb1a5d 100644 --- a/helm/templates/minio.yaml +++ b/helm/templates/minio.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ include "ragflow.fullname" . }}-minio + annotations: + "helm.sh/resource-policy": keep labels: {{- include "ragflow.labels" . | nindent 4 }} app.kubernetes.io/component: minio diff --git a/helm/templates/mysql.yaml b/helm/templates/mysql.yaml index f47fc0ef3..2ec6dcd78 100644 --- a/helm/templates/mysql.yaml +++ b/helm/templates/mysql.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ include "ragflow.fullname" . }}-mysql + annotations: + "helm.sh/resource-policy": keep labels: {{- include "ragflow.labels" . | nindent 4 }} app.kubernetes.io/component: mysql diff --git a/helm/templates/redis.yaml b/helm/templates/redis.yaml index 9ac1e951f..53e7a6781 100644 --- a/helm/templates/redis.yaml +++ b/helm/templates/redis.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: Service metadata: name: {{ include "ragflow.fullname" . }}-redis + annotations: + "helm.sh/resource-policy": keep labels: {{- include "ragflow.labels" . | nindent 4 }} app.kubernetes.io/component: redis