Skip to content

Commit c26962b

Browse files
authored
Merge pull request zalando#315 from zalando-incubator/feature/doc-volume-increase
Add section about volume increase
2 parents 681656c + df40cd8 commit c26962b

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/user.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,40 @@ metadata:
242242

243243
Note that timezone required for `timestamp` (offset relative to UTC, see RFC
244244
3339 section 5.6)
245+
246+
## Increase volume size
247+
248+
PostgreSQL operator supports statefulset volume resize if you're using the
249+
operator on top of AWS. For that you need to change the size field of the
250+
volume description in the cluster manifest and apply the change:
251+
252+
```
253+
apiVersion: "acid.zalan.do/v1"
254+
kind: postgresql
255+
256+
metadata:
257+
name: acid-test-cluster
258+
spec:
259+
volume:
260+
size: 5Gi # new volume size
261+
```
262+
263+
The operator compares the new value of the size field with the previous one and
264+
acts on differences.
265+
266+
You can only enlarge the volume with the process described above, shrinking is
267+
not supported and will emit a warning. After this update all the new volumes in
268+
the statefulset are allocated according to the new size. To enlarge persistent
269+
volumes attached to the running pods, the operator performs the following
270+
actions:
271+
272+
* call AWS API to change the volume size
273+
274+
* connect to the pod using `kubectl exec` and resize the filesystem with
275+
`resize2fs`.
276+
277+
Fist step has a limitation, AWS rate-limits this operation to no more than once
278+
every 6 hours.
279+
Note that if the statefulset is scaled down before resizing the size changes
280+
are only applied to the volumes attached to the running pods. The size of the
281+
volumes that correspond to the previously running pods is not changed.

0 commit comments

Comments
 (0)