Expand Kubernetes storage
This how-to guide explains how to safely expand Kubernetes PersistentVolumeClaims (PVCs) used by Hybrid Manager and EDB-managed Postgres services.
For general storage architecture recommendations, see Kubernetes storage best practices. For overall management tasks, see Manage Kubernetes storage.
Important: Storage behavior and expansion processes differ across cloud providers and Kubernetes platforms.
When to expand PVCs
Common reasons to expand PVCs:
- Postgres database volume is nearing capacity.
- WAL volume (if used) is filling up.
- Monitoring or alerting indicates PVC usage approaching threshold (e.g. 80% full).
- Workload growth requires more storage.
PVCs in Kubernetes do not shrink automatically — proactive expansion is required to avoid out-of-space conditions.
Preconditions for expansion
Ensure that:
- The StorageClass in use supports
allowVolumeExpansion: true. - The cloud provider / CSI driver supports online volume expansion.
- Postgres operator version supports safe expansion workflows (Hybrid Manager operators do in current releases).
- You understand platform-specific behaviors
Expansion workflow
1. Determine target PVC
Identify the PVC to expand:
- Postgres data volume (typically named like
<cluster-name>-<instance-id>). - WAL volume (if used, named like
<cluster-name>-<instance-id>-wal).
Use kubectl get pvc -n <namespace> to list PVCs.
2. Review current PVC status
Check current capacity and usage:
- Use monitoring dashboards or
kubectl describe pvcto checkCapacityandUsed.
Validate that PVC is Bound and not in an error state before proceeding.
3. Edit PVC size
Increase requested size:
- Edit the PVC resource using
kubectl edit pvc <pvc-name> -n <namespace>. - Modify the
spec.resources.requests.storagefield to desired size (must be larger than current).
Example: increase from 100Gi to 200Gi.
4. Validate expansion
Kubernetes will initiate volume expansion:
- For supported platforms, the underlying cloud volume will resize automatically.
- The Postgres Pod may need to be restarted for the filesystem to recognize new space.
Verify:
- PVC
Capacitynow shows new size. - Postgres Pod restarts cleanly and mounts expanded volume.
- Postgres logs show correct available space (check
df -hinside container if needed).
5. Monitor after expansion
After expansion:
- Monitor volume usage trends.
- Validate Postgres workload resumes normal operation.
- Adjust alerting thresholds as needed.
Expansion is usually transparent to applications but always validate Postgres behavior post-expansion.
Troubleshooting
Common issues:
- Expansion blocked — check StorageClass settings and platform support.
- Postgres Pod fails to mount expanded volume — check CSI driver logs and platform events.
- Filesystem does not recognize new space — Pod restart may be required on some platforms.
- Expansion takes longer than expected — check cloud provider volume resize status.
See Troubleshooting Kubernetes for general patterns.
Summary checklist
- Identify PVC to expand and validate preconditions.
- Edit PVC and increase
spec.resources.requests.storage. - Monitor expansion progress and validate new capacity.
- Validate Postgres application behavior after expansion.
- Monitor and adjust alerting post-expansion.
Related topics
Could this page be better? Report a problem or suggest an addition!