/data.
StorageSpec
Thestorage field in RedisClusterSpec defines the PVC template.
Requested storage size per pod.Example values:
1Gi, 10Gi, 100Gi, 1TiName of the StorageClass to use. If omitted, uses the cluster default.
PVC Naming Convention
PVCs follow the pattern:<cluster-name>-data-<ordinal>
Example:
PVC Lifecycle States
The operator tracks PVC health instatus.healthyPVC and status.danglingPVC.
Healthy PVCs
PVCs that:- Exist and are
Bound - Match the desired storage size (or expansion in progress)
- Correspond to an active pod (ordinal <
spec.instances)
status.healthyPVC
Dangling PVCs
PVCs that exist but have no corresponding pod. This happens when:- Cluster was scaled down (instances reduced)
- Pod was deleted but PVC persists
status.danglingPVC
Resizing PVCs
Whenspec.storage.size is increased, the operator:
- Checks if the StorageClass supports
allowVolumeExpansion - Patches each PVC’s
spec.resources.requests.storage - Waits for the filesystem resize to complete
Unusable PVCs
PVCs that cannot be expanded due to:- StorageClass does not support
allowVolumeExpansion - StorageClass not found
Volume Expansion Examples
Expand storage from 10Gi to 50Gi
-
Edit the cluster spec:
-
Apply the change:
-
Monitor expansion:
-
Wait for
PVCResizeInProgresscondition to becomeFalse:
Check if StorageClass supports expansion
false or not set, expansion will fail. Update the StorageClass:
Implementation Details
Frominternal/controller/cluster/pvcs.go:21-183:
PVC Creation
The operator creates PVCs with:- AccessMode:
ReadWriteOnce - Labels:
redis.io/cluster=<cluster-name> - Requests:
storage: <spec.storage.size>
pvcs.go:224-253 for the full creation logic.
Expansion Logic
The operator checks expansion feasibility:pvcs.go:185-211 for the implementation.
Filesystem Resize Detection
The operator watches for theFileSystemResizePending condition:
pvcs.go:213-222.
Best Practices
Use StorageClasses with expansion enabled
Always configureallowVolumeExpansion: true for production clusters:
Monitor PVC usage
Set up alerts for disk usage:Plan for growth
Expansion is online (no downtime), but:- Large expansions may take time depending on the storage backend
- Some cloud providers rate-limit volume modifications
Clean up dangling PVCs carefully
spec.instances). This will cause data loss.
Troubleshooting
PVC stuck in Pending
Symptom:- StorageClass does not exist
- No available storage
- Node affinity constraints not satisfied
Expansion not completing
Symptom:Accidental PVC deletion
Prevention: UsereclaimPolicy: Retain on PersistentVolumes:
Retain, the PV still exists: