Skip to main content
As workload demands change, you will need to adjust the resources allocated to your PostgreSQL cluster. PGO supports two classes of resize: storage volume expansion and compute (CPU and memory) changes. Each behaves differently in terms of disruption to your running cluster.

Resize storage volumes

PostgreSQL instance storage is defined by dataVolumeClaimSpec (and optionally walVolumeClaimSpec) inside each instances entry. To increase the volume size, update the resources.requests.storage value and apply the change.
PVC expansion requires that the underlying StorageClass has allowVolumeExpansion: true. Shrinking a volume is not supported by Kubernetes and will be rejected.
PGO propagates the updated storage request to the underlying PersistentVolumeClaim. The storage expansion is performed by the Kubernetes volume provisioner and typically does not require a pod restart, though this depends on the provisioner. You can watch the resize progress by checking the PersistentVolumeResizing condition on the PostgresCluster status:

WAL volume

If you configured a separate WAL volume using walVolumeClaimSpec, resize it the same way:

Automatic volume growth

PGO includes an AutoGrowVolumes feature gate (alpha, enabled by default) that can automatically expand volumes before they run out of space, eliminating the need for manual intervention. To configure auto-grow, add an autoGrow stanza inside dataVolumeClaimSpec or walVolumeClaimSpec. Auto-grow requires that the PVC has a storage limit set.

AutoGrowSpec fields

The AutoGrowVolumes feature gate is alpha-stage but enabled by default. If you need to disable it, set AutoGrowVolumes=false in the operator’s feature gate configuration. See Feature Gates.

Resize compute (CPU and memory)

CPU and memory for PostgreSQL instance pods are controlled by the resources field inside each instances entry. This follows the standard Kubernetes ResourceRequirements structure.
Changing the resources field causes the instance pods to restart. PGO performs a rolling restart, so the cluster will remain available as long as you have replicas running. Set minAvailable to control how many pods must stay up during the rollout.

Control disruption with minAvailable

Use minAvailable to ensure a minimum number of pods remain healthy during a rolling restart:

Changes that do not restart pods

The following storage-related changes do not cause pod restarts:
  • Increasing dataVolumeClaimSpec.resources.requests.storage (volume expansion only, no pod restart when the StorageClass supports online resizing)
  • Modifying autoGrow.trigger or autoGrow.maxGrow
The following changes do cause pod restarts:
  • Updating resources (CPU/memory) on an instance set
  • Changing dataVolumeClaimSpec.storageClassName
  • Adding or removing a walVolumeClaimSpec
  • Changing affinity, tolerations, or topologySpreadConstraints

Next steps

Upgrade PostgreSQL versions

Perform minor and major version upgrades on your cluster.

Customize cluster configuration

Tune postgresql.conf parameters and pod scheduling constraints.