Open alex-arica opened 3 years ago
In the meantime if anyone tries to resize kubegres pvc-s, here is my step-by-step howto. Might need fine tuning and is as-is so experiment with this in nonprod environments first! Feel free to complement this with further info.
kubectl scale --replicas=0 deployment.apps/kubegres-controller-manager -n kubegres-system
kubectl get deployment kubegres-controller-manager -n kubegres-system
kubectl get sts kubegres-1 -o yaml > kubegres-1.yaml
kubectl replace --force -f kubegres-1.yaml
kubectl scale --replicas=0 sts kubegres-1
https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/
wait for pvc resize condition message: Waiting for user to (re-)start a pod to finish file system
kubectl scale --replicas=1 sts kubegres-1
kubectl scale --replicas=1 deployment.apps/kubegres-controller-manager -n kubegres-system
Similar. https://serverfault.com/questions/955293/how-to-increase-disk-size-in-a-stateful-set
https://learn.microsoft.com/en-us/azure/azure-arc/data/resize-persistent-volume-claim
Or looks like it just works updating pvc(s) each to size, at least with Azure managed-csi storage class on azure.
Currently, Kubernetes does not allow the support for volume expansion through StatefulSets. And when a PVC is manually updated, it is unable to automatically update a StatefulSet.
To allow to expand the storage of an existing cluster of Postgres, we have to wait on the release of the Kubernetes enhancement kubernetes/enhancements#2842 which aims in addressing this issue by allowing support for volume expansion through StatefulSets.
Once that feature is available in Kubernetes, this feature can be available in Kubegres via this ticket.