feat: Add persistent volume support for ValkeyCluster#85
feat: Add persistent volume support for ValkeyCluster#85umar-riswan-ap wants to merge 3 commits intovalkey-io:mainfrom
Conversation
umar-riswan-ap
commented
Feb 16, 2026
- Add StorageSpec to ValkeyCluster API with enabled, size, storageClassName, and accessModes fields
- Add VolumePermissions field to enable init container for volume ownership
- Implement StatefulSet support for persistent storage with PVC templates
- Keep Deployment support for ephemeral storage (emptyDir)
- Update valkey.conf with dir /data and AOF persistence settings
- Add security contexts (non-root user 1001, drop ALL capabilities)
- Add init container to chown /data directory when volumePermissions=true
- Update RBAC with StatefulSet and PVC permissions
- Add two sample configurations: persistent and ephemeral
- Update README with storage features and examples
- Tested on EKS with gp3 storage class
- Add StorageSpec to ValkeyCluster API with enabled, size, storageClassName, and accessModes fields - Add VolumePermissions field to enable init container for volume ownership - Implement StatefulSet support for persistent storage with PVC templates - Keep Deployment support for ephemeral storage (emptyDir) - Update valkey.conf with dir /data and AOF persistence settings - Add security contexts (non-root user 1001, drop ALL capabilities) - Add init container to chown /data directory when volumePermissions=true - Update RBAC with StatefulSet and PVC permissions - Add two sample configurations: persistent and ephemeral - Update README with storage features and examples - Tested on EKS with gp3 storage class Signed-off-by: Umar Riswan A P <umarriswanap@gmail.com>
e96f66c to
c549bf3
Compare
Signed-off-by: UMAR RISWAN A P <umarriswanap@gmail.com>
|
Hi @umar-riswan-ap , thanks for the contribution! Persistence support is definitely something we want in the operator. We're currently fleshing out the design for this. One key constraint is that StatefulSet VolumeClaimTemplates have immutable size fields, so we're exploring We're going to keep open this PR for now until we've voted on whether the ValkeyNode CRD will go ahead. If you're interested in contributing further, the best way to get involved would be to join the RFC discussion above or open an issue/discussion so we can align on design before implementation. Thanks again! |
Implements automatic PVC expansion when storage size is increased in ValkeyCluster spec. Features: - Detects storage size changes and patches PVCs automatically - Validates StorageClass supports allowVolumeExpansion - Monitors expansion progress with status conditions - Zero downtime - cluster remains operational during expansion - Emits events for expansion stages (VolumeExpanding/VolumeExpanded) - Requeues every 10s during expansion to monitor progress Changes: - Added internal/controller/volume_expansion.go with expansion logic - Updated valkeycluster_controller.go to integrate expansion checks - Added ReasonVolumeExpanding and ReasonVolumeExpanded status reasons - Added StorageClass RBAC permissions (storage.k8s.io) - Created comprehensive documentation and example manifests Tested: - Successfully expanded 12 PVCs from 2Gi to 5Gi on EKS cluster - AWS EBS gp3 volumes with allowVolumeExpansion enabled - Verified zero downtime and data integrity Closes: Volume expansion feature request Signed-off-by: Umar Riswan A P <umarriswanap@gmail.com>
496d3d2 to
75b6d18
Compare
|
@jdheyburn Thanks for the update! I completely understand the complexity around StatefulSet VolumeClaimTemplates being immutable. I've actually been working on an enhancement that addresses online PV scaling for graceful storage expansion without disruption and commited that too here. I'd be happy to share my approach in the RFC discussion or open a separate issue to discuss how it might complement the ValkeyNode controller design. |
|
@umar-riswan-ap Would you mind starting up a new discussion on how volumes would be managed, and how we'd get round volume expansion too? Thanks! |