-
Notifications
You must be signed in to change notification settings - Fork 129
Description
Support independent PVC retention policies (whenDeleted/whenScaled) in SolrCloud deployments
Is your feature request related to a problem?
In Kubernetes 1.27+ a new feature was added where a retention policy can be used to control if and when PVCs created from a StatefulSet's volumeClaimTemplate are deleted.
The Apache Solr Operator currently does not expose the StatefulSet persistentVolumeClaimRetentionPolicy feature through the SolrCloud CRD configuration. The operator only provides basic PVC management through dataStorage.persistent.reclaimPolicy, which applies the same policy to both deletion and scaling scenarios.
Describe the solution you'd like.
The ability to configure whenDeleted and whenScaled policies independently through the SolrCloud CRD:
# Current limitation:
spec:
dataStorage:
persistent:
reclaimPolicy: "Retain" # Same for both scenarios
# Desired configuration:
spec:
dataStorage:
persistent:
reclaimPolicy:
whenDeleted: "Retain" # Keep PVCs during maintenance
whenScaled: "Delete" # Clean up PVCs during scalingThis would generate the appropriate StatefulSet persistentVolumeClaimRetentionPolicy configuration.
Describe alternatives you've considered.
Manual StatefulSet patching works but is overwritten during AroCD sync's
Kustomize overlays are overwritten during deployment.
Additional context.
Environment: Enterprise Kubernetes (AKS) with GitOps using ArgoCD and Kustomize
Use Case: Need different retention behaviors for maintenance workflows (retain data) vs dynamic scaling operations (cleanup for cost optimization).
Precedent: This feature has been implemented in other Helm charts:
- [Prometheus community charts (Issue #3711)]([prometheus] StatefulSet PVC Retention Policy prometheus-community/helm-charts#3711)
- [Bitnami Solr chart (PR #33272)]([bitnami/solr] Add persistentvolumeclaim retention on solr statefulset bitnami/charts#33272)
Backward Compatibility: Existing reclaimPolicy string format should continue working to set both policies to the same value.