From 272454fa610373021555c92a7109fed5b294e70c Mon Sep 17 00:00:00 2001 From: Linying Assad Date: Mon, 29 Jun 2026 15:30:46 +0800 Subject: [PATCH] Add FoundationDB chart retention guardrails --- helm-charts/doris-foundationdb/README.md | 20 ++++++++++++++++++- .../templates/foundationdb.yaml | 4 ++++ helm-charts/doris-foundationdb/values.yaml | 8 ++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/helm-charts/doris-foundationdb/README.md b/helm-charts/doris-foundationdb/README.md index e19810a2..063c0142 100644 --- a/helm-charts/doris-foundationdb/README.md +++ b/helm-charts/doris-foundationdb/README.md @@ -22,4 +22,22 @@ The foundationdb cluster is a practice for doris. 4. Install doris-foundationdb ```Bash $ helm install doris-foundationdb selectdb/doris-foundationdb - ``` \ No newline at end of file + ``` + +## Data safety notes + +- Keep FoundationDB in a dedicated Helm or Flux release. Doris configMap or compute-group changes should not rebuild the FoundationDB release. +- This chart keeps the `FoundationDBCluster` resource by default with `helm.sh/resource-policy: keep` to reduce accidental metadata loss during Helm uninstall or release replacement. +- Use a `StorageClass` with `reclaimPolicy=Retain` for FoundationDB metadata volumes. The PVC template controls claim shape, but the `StorageClass` controls PV retention behavior. + +Example values: + +```yaml +keepClusterResource: true +volumeClaimTemplate: + spec: + storageClassName: retain-sc + resources: + requests: + storage: 50G +``` diff --git a/helm-charts/doris-foundationdb/templates/foundationdb.yaml b/helm-charts/doris-foundationdb/templates/foundationdb.yaml index 38d3a294..14af402b 100644 --- a/helm-charts/doris-foundationdb/templates/foundationdb.yaml +++ b/helm-charts/doris-foundationdb/templates/foundationdb.yaml @@ -19,6 +19,10 @@ apiVersion: apps.foundationdb.org/v1beta2 kind: FoundationDBCluster metadata: name: {{ include "foundationdb.clusterName" . }} + {{- if .Values.keepClusterResource }} + annotations: + helm.sh/resource-policy: keep + {{- end }} spec: databaseConfiguration: redundancy_mode: {{ template "foundationdb.redundancyMode" }} diff --git a/helm-charts/doris-foundationdb/values.yaml b/helm-charts/doris-foundationdb/values.yaml index e8e7df65..e17bf397 100644 --- a/helm-charts/doris-foundationdb/values.yaml +++ b/helm-charts/doris-foundationdb/values.yaml @@ -1,6 +1,11 @@ # specify the foundationdb cluster name name: test-cluster +# Keep the FoundationDBCluster object during Helm uninstall or release +# replacement so that unrelated Doris chart changes do not implicitly tear +# down the metadata cluster. +keepClusterResource: true + #specify the data replicas. enum: single, double, triple redundancy_mode: "double" @@ -34,8 +39,11 @@ resources: # VolumeClaimTemplate allows customizing the persistent volume claim for the pod. # this config reference the kubernetes doc about statefulset volumeClaimTemplate: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/ +# Production metadata volumes should use a StorageClass with +# reclaimPolicy=Retain. PVC template fields alone do not control PV retention. volumeClaimTemplate: spec: + # storageClassName: retain-sc resources: requests: storage: 50G