postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Automatically increase size of PVCs

Open gricey432 opened this issue 2 years ago • 2 comments

Overview

Crunchy Data recommends leaving a proportional amount of space free on disk. However it's currently a manual process to monitor disk consumption and modify the PostgresCluster spec to add space as databases grow.

PGO can see disk usage inside the pods and also creates the PVC, so it's better placed to run the feedback loop than an external system.

Use Case

We're running a large number of smallish Postgres Clusters on PGO and it's a lot of manual work to monitor each database's disk capacity and update the manifests. This is done through gitops and the PostgresCluster manifests are generated from code and config in a repo.

Desired Behavior

dataVolumeClaimSpec is modified (or have a sibling setting) to no longer require the storage request and instead takes an initial size, desired ratio, and maximum size. Similar to AWS RDS's storage autoscaling. Other possible settings could be step, or just rules logic like RDS.

The k8s docs on resizing also mention that there's a once-per-6-hour limit on EBS resizing per volume. So it might need like a "poll frequency" setting.

Environment

  • Platform: EKS
  • Platform Version: eks.2 1.23
  • PGO Image Tag: ubi8-5.2.2-0
  • Postgres Version 14
  • Storage: ebs

Additional Information

Automating this around PGO is possible but it makes proper gitops very hard. If you want to keep your PostgresCluster manifests committed you end up needing some system to pull storage usage from prometheus and then do git commits and kubectl applies. This sucks compared to the declarative solution it could have inside PGO.

gricey432 avatar Apr 13 '23 06:04 gricey432

@gricey432, thank you very much for your feature request. We have a story in our dev backlog for implementing this feature. I will make a note with your thoughts/suggestions.

dsessler7 avatar Apr 17 '23 22:04 dsessler7

Hello, @gricey432, the new v5.6 release now has this functionality. Please see the docs for more info.

(But I will note: this new functionality is behind a feature gate, so you'll have to turn that on to get this behavior.)

I'll leave this issue open for a few days, but I think this new behavior answers your request. If you get a chance to try it out, please let us know what you think!

benjaminjb avatar Jun 26 '24 18:06 benjaminjb