feat: make StorageClass reclaimPolicy configurable via values.yaml - #10040
Merged
Conversation
Collaborator
|
Auto Cherry-pick Instructions |
leon-ape
approved these changes
Feb 6, 2026
cjc7373
approved these changes
Feb 6, 2026
Collaborator
|
hi @srikxcipher don't forget to sign the CLA. |
Contributor
Author
Done ... |
Collaborator
|
/cherry-pick release-1.1 |
Collaborator
|
/cherry-pick release-1.0 |
Collaborator
|
🤖 says: cherry pick action finished successfully 🎉! |
Collaborator
|
🤖 says: cherry pick action finished successfully 🎉! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
reclaimPolicy: Deleteis hardcoded as a literal indeploy/helm/templates/storageclass.yamlfor all six cloud providers (AWS, GCP, Alibaba, Tencent, Azure, Huawei). Otherfields in the same template —
volumeType,fsType— are already templated throughvalues.yaml, butreclaimPolicyis not.This means there is no way to set
reclaimPolicy: Retainon the KubeBlocks-provisioned StorageClass without either skipping StorageClass creation entirely or patching everyPV individually after provisioning. For datastore workloads (MongoDB, PostgreSQL, MySQL, Redis), this removes the standard Kubernetes safety net against accidental PVC
deletion — particularly dangerous when combined with
terminationPolicy: Delete, which explicitly deletes PVCs during cluster teardown.Changes
deploy/helm/templates/storageclass.yaml— replaced hardcodedreclaimPolicy: Deletein all six provider blocks with{{ .Values.storageClass.reclaimPolicy | default "Delete" }}deploy/helm/values.yaml— addedstorageClass.reclaimPolicywith defaultDeleteBehaviour
Delete— zero change for any existing install unless the value is explicitly sethelm upgrade kubeblocks kubeblocks/kubeblocks --set storageClass.reclaimPolicy=RetainMigration note for existing clusters
reclaimPolicyis inherited by each PV at creation time only. Changing the StorageClass does not retroactively update already-provisioned PVs. Existing PVs must bepatched individually: