> ## Documentation Index
> Fetch the complete documentation index at: https://metoro.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Upscale PVC

> Increase bundled PostgreSQL PVC capacity for Metoro on-premises deployments

Use this runbook when bundled PostgreSQL needs more PVC capacity. This applies to PostgreSQL created by the `metoro-onprem` chart and managed by CloudNativePG.

If PostgreSQL is externally managed, resize storage through the team and tooling that operate that PostgreSQL service. The Metoro chart does not manage external PostgreSQL PVCs.

## What To Change

The `postgres.bundled.cluster.storage.size` Helm value controls the PGDATA PVC size for each PostgreSQL instance. The chart renders this value into `spec.storage.size` on the CloudNativePG `Cluster` named `metoro-postgresql`.

Increase the value in `metoro-hub-values.yaml`:

```yaml theme={null}
postgres:
  bundled:
    cluster:
      storage:
        size: 100Gi
```

If separate WAL storage is already enabled, `postgres.bundled.cluster.walStorage.size` controls the WAL PVC size for each PostgreSQL instance:

```yaml theme={null}
postgres:
  bundled:
    cluster:
      walStorage:
        enabled: true
        size: 10Gi
```

Do not use this runbook to enable or disable separate WAL storage on an existing cluster. CloudNativePG does not support removing WAL storage after it has been added.

Use a value larger than the current PVC size. Kubernetes PVCs normally support expansion, not shrinking.

## Prerequisites

Before applying the change, confirm:

* The PostgreSQL StorageClass supports volume expansion, for example `allowVolumeExpansion: true`.
* The StorageClass is retained and appropriate for database workloads.
* The backing storage provider has enough free capacity for every PostgreSQL instance.
* The new size is larger than the current PostgreSQL PVC size.

You can check PostgreSQL PVCs and StorageClasses with:

```bash theme={null}
kubectl -n metoro-hub get pvc -l cnpg.io/cluster=metoro-postgresql
kubectl get storageclass
```

## Apply The Change

Apply the updated values with the same Helm release and chart version used for the hub:

```bash theme={null}
helm upgrade --install metoro oci://quay.io/metoro/charts/metoro-onprem \
  --namespace metoro-hub \
  --version 10.4.0 \
  --values metoro-hub-values.yaml
```

## What Happens

After the Helm upgrade, the CloudNativePG `Cluster` named `metoro-postgresql` updates its `spec.storage.size`. If WAL storage is enabled and changed, `spec.walStorage.size` also updates.

CloudNativePG applies the new storage requirement to the relevant PostgreSQL PVCs. Kubernetes and the storage provider then expand each PVC.

If the StorageClass supports online volume resizing, the larger filesystem may become available without restarting pods. If the storage driver requires a remount or pod restart, delete one PostgreSQL pod at a time so CloudNativePG recreates it, starting with standby instances and waiting for each pod to become ready before moving on. Leave the primary until last.

Do not delete PostgreSQL PVCs as part of the normal expansion workflow.

## Verify The Rollout

Check that the CloudNativePG cluster exists and is being reconciled:

```bash theme={null}
kubectl -n metoro-hub get cluster.postgresql.cnpg.io metoro-postgresql
```

Confirm the desired PGDATA storage value matches the new Helm value:

```bash theme={null}
kubectl -n metoro-hub get cluster.postgresql.cnpg.io metoro-postgresql \
  -o jsonpath='{.spec.storage.size}{"\n"}'
```

Watch PostgreSQL PVCs and confirm they show the larger requested capacity:

```bash theme={null}
kubectl -n metoro-hub get pvc -l cnpg.io/cluster=metoro-postgresql
```

Watch PostgreSQL pods and roles while CloudNativePG reconciles:

```bash theme={null}
kubectl -n metoro-hub get pods -l cnpg.io/cluster=metoro-postgresql \
  -L cnpg.io/instanceRole -w
```

Check recent events if PVCs or pods are slow to converge:

```bash theme={null}
kubectl -n metoro-hub get events --sort-by='.lastTimestamp'
```

The expected outcome is:

* The CloudNativePG cluster desired storage matches `postgres.bundled.cluster.storage.size`.
* PostgreSQL PVCs show the larger requested capacity.
* PostgreSQL pods remain ready, or are restarted one at a time if the storage driver requires a remount.
* Apiserver and Temporal recover automatically if PostgreSQL readiness briefly changes.

Do not manually patch PostgreSQL PVCs as the normal workflow. Keep `metoro-hub-values.yaml` as the source of truth and let Helm, the CloudNativePG `Cluster`, and CloudNativePG reconcile the change.
