zalando / zalando/postgres-operator
Static PV
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Description
Please, answer some short questions which should help us to understand your problem / question better?
- Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.9.0
- Where do you run it - cloud or metal? Kubernetes or OpenShift? Bare Metal K8s
- Are you running Postgres Operator in production? no
- Type of issue? [Bug report, question, feature request, etc.] question
I have difficulties with a change in the size of static volumes for the database.
I created two static PVs of 10Gi size with rbd.csi.ceph.com and PostgreSQL cluster with these PVs:
numberOfInstances: 2
volume:
selector:
matchLabels:
application: spilo
cluster-name: acid-test04
team: acid
size: 10Gi
Then I expand volumes:
- RBD volumes to 12 Gi.
- pv.spec.capacity.storage to 12Gi.
- postgresql.spec.volume.size to 12 Gi.
pvc.status.capacity.storage has been automatically changed to 12Gi but pvc.spec.resources.requests.storage still 10Gi.
There is no option to change pvc.spec.resource.requests.storage for static volumes.
Postgres Cluster Status is SyncFailed with warning:
could not sync cluster: could not sync persistent volume claims: could not sync volume claims: could not update persistent volume claim: "persistentvolumeclaims "pgdata-acid-test04-0" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize"
The function volumeClaimsNeedResizing() in Operator compare pvc.spec.resources.requests.storage with current size.
The documentation says: Once PVC is expanded on backend and same is reflected size is reflected on application mountpoint, the status capacity pvc.status.capacity.storage of PVC will be updated to new size volume
Maybe function volumeClaimsNeedResizing() should check the pvc.status.capacity.storage instead of the pvc.spec.resource.requests.storage?
Is it possible to resize static volumes? If so, how to do it right?
Thank you for any advice here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating volumeClaimsNeedResizing() and tracing the persistent volume claim reconciliation path. Reproduce the static-volume resize scenario described with RBD-backed PVs, then determine whether comparing PVC status or spec is appropriate. Done means the cluster no longer reports SyncFailed after a supported resize, or the issue documents that static volumes cannot be resized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, postgresql
- Domain
- databases, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100