feat(dgraph): add persistentVolumeClaimRetentionPolicy support - #136
Closed
mlwelles wants to merge 1 commit into
Closed
feat(dgraph): add persistentVolumeClaimRetentionPolicy support#136mlwelles wants to merge 1 commit into
mlwelles wants to merge 1 commit into
Conversation
Expose persistentVolumeClaimRetentionPolicy on the Alpha and Zero StatefulSets so PVCs (and their backing cloud volumes) are handled deliberately on `helm uninstall` and scale-down, instead of being left orphaned with no chart-level way to opt into cleanup. The field renders only when persistence is enabled and the policy object is set, so existing releases are unaffected: the default values leave it unset, preserving Kubernetes' own Retain/Retain behavior and producing identical manifests. Operators opt in by setting whenDeleted/whenScaled to Retain or Delete. Requires Kubernetes >= 1.27, where the field is GA.
Author
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.
What
Expose
persistentVolumeClaimRetentionPolicyon the Alpha and Zero StatefulSets, configurable per tier underpersistence.Why
The chart hard-codes the StatefulSet spec without this field, so Kubernetes applies its
Retain/Retaindefault implicitly. PVCs (and the cloud volumes behind them) are therefore left orphaned onhelm uninstalland on scale-down, with no chart-level way to opt into cleanup. This change lets operators set the policy deliberately and see it in the rendered manifests.Behavior
Non-breaking and opt-in. The default values leave the policy unset, and the template renders the field only when persistence is enabled and the policy object is set. Existing releases produce identical manifests. Operators opt in by setting
whenDeletedand/orwhenScaledtoRetainorDelete; an unset sub-key falls back toRetain.Changes
templates/alpha/statefulset.yaml,templates/zero/statefulset.yaml: render aspec-levelpersistentVolumeClaimRetentionPolicyblock, guarded on persistence being enabled and the policy being set.values.yaml: document the value (commented) under bothalpha.persistenceandzero.persistence.README.md: add the value to the configuration tables.Validation
helm lintpasses.helm templateoutput is unchanged (field omitted).--set alpha.persistence.persistentVolumeClaimRetentionPolicy.whenDeleted=DeleterenderswhenDeleted: DeletewithwhenScaleddefaulting toRetain.Notes
persistentVolumeClaimRetentionPolicyis GA as of Kubernetes 1.27. Chart version unchanged, since the version tracks the Dgraph release; happy to adjust to match maintainer preference.