refactor(app): use StatefulSet for persistence instead of standalone PVCs#10
Merged
Merged
Conversation
Replace standalone PVC + Deployment approach with conditional resource: - persistence disabled → Deployment (stateless, any replica count) - persistence enabled → StatefulSet with volumeClaimTemplates (per-pod PVCs) Extract shared pod template into _helpers.tpl to avoid duplication. Delete pvc.yaml — StatefulSet manages PVC lifecycle automatically. Bump chart version to 1.2.0.
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.
Summary
Deployment(stateless, any replica count)StatefulSetwithvolumeClaimTemplates(per-pod PVCs, stable identity)_helpers.tpl(app.podTemplate) to avoid duplicationpvc.yaml— StatefulSet manages PVC lifecycle automaticallyThis is the idiomatic K8s pattern: StatefulSet creates a unique PVC per pod replica (e.g.
data-myapp-0,data-myapp-1), so scaling withReadWriteOnceworks correctly. ArgoCD with pruning will handle the Deployment → StatefulSet transition.Follows up on #9.
Test plan
helm lint app/passeshelm templatewithout persistence renders Deployment (no StatefulSet)helm templatewith persistence renders StatefulSet with volumeClaimTemplates (no Deployment)