feat(common): add statefulset template alongside deployment#68
Merged
Conversation
Adds an opt-in StatefulSet mode to the common chart for stateful single-replica workloads (raita-bot is the first consumer). Mirrors deployment.yaml structure so existing values map 1:1 — only the kind, serviceName, and podManagementPolicy fields are new. - templates/statefulset.yaml: gated on `statefulset.enabled`. Adds terminationGracePeriodSeconds + container `lifecycle` hooks (e.g. preStop sleep) that the deployment template doesn't surface. - templates/pvc.yaml + storageclass.yaml: now iterate the union of `deployment.volumes` and `statefulset.volumes` so PVCs/StorageClasses get created regardless of which workload kind is enabled. PVC name pattern is unchanged (`<fullname>-<volume>-pvc`), so a Deployment can be flipped to a StatefulSet on the same release without re-provisioning storage — the existing PVC binds. - values.yaml: new `statefulset:` section documenting the schema and marking it mutually exclusive with `deployment.enabled`. - Chart.yaml: 0.2.3 → 0.3.0 (minor — additive feature, backward compatible; existing services with `deployment.enabled: true` continue to work unchanged). Volume claim templates (per-replica volumes) intentionally not added in this iteration — needs more thought on multi-replica StatefulSets and PVC lifecycle. Today's mode supports the single-replica migration case which is what raita-bot needs.
🎉 Helm Chart Tests Passed!All modified charts have been successfully validated:
Summary:
📋 Detailed Information:
The PR is ready for review! 🚀 Note: Charts will be automatically released when this PR is merged to main. |
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
Adds opt-in StatefulSet mode to the common chart. Mirrors
deployment.yaml1:1 — onlykind,serviceName,podManagementPolicy,terminationGracePeriodSeconds, and containerlifecycleare new.deployment.enabled: true(existing — unchanged)statefulset.enabled: true(new)First consumer is raita-bot (Discord daemon with EBS-backed Hermes profile). Multi-Attach errors during deploys + cleaner serial pod replacement semantics motivated the change.
What's new
templates/statefulset.yaml— gated onstatefulset.enabled. Surfaces `terminationGracePeriodSeconds` + container `lifecycle` hooks (preStop sleep, etc.) which the deployment template doesn't currently expose.templates/pvc.yaml+templates/storageclass.yaml— now iterate the union of `deployment.volumes` and `statefulset.volumes` so PVCs/StorageClasses are created regardless of which workload kind is enabled.values.yaml— new `statefulset:` section, fully documented inline.PVC name preservation = seamless migration
The PVC name pattern (
<fullname>-<volume>-pvc) is identical between the two templates. A consumer can flip from Deployment to StatefulSet on the same Helm release without re-provisioning storage — the StatefulSet binds to the existing PVC.For raita-bot specifically:
Migration sequence (for the consumer)
Out of scope
Test plan
Companion PR