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):
This commit is contained in:
Jason Li 2025-05-12 04:23:49 +02:00 committed by GitHub
parent 29f45a85e4
commit af35e84655
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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