Skip to content

Commit 5d65c49

Browse files
committed
Document one-shot mode for Kubernetes
1 parent e60917f commit 5d65c49

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,32 @@ The container has to run as `root` if using `one shot` mode, otherwise we are un
112112
> [!WARNING]
113113
> As of writing this paragraph (14th of November, 2024), we only tested upgrading from Bitnami Postgres v13, v14, v15, v16 to v17. For these versions, we used the latest available container version. Bitnami's script and directory structure could change over time. If you note any issues upgrading from other versions, please provide the exact SHA of the image so we can try to replicate the issue.
114114
115+
### One-shot mode in Kubernetes
116+
117+
You can run `pgautoupgrade` as an `initContainer` in Kubernetes to enable one-shot mode. Below you can find an example for an upgrade for a Bitnami Postgres container.
118+
119+
```yaml
120+
initContainers:
121+
- env:
122+
- name: PGAUTO_ONESHOT
123+
value: "yes"
124+
- name: POSTGRES_DB
125+
value: XXX
126+
- name: PGDATA
127+
value: /bitnami/postgresql/data
128+
- name: POSTGRES_PASSWORD
129+
value: password
130+
image: ghcr.io/pgautoupgrade/pgautoupgrade:fix-with-bitnami-image-debian
131+
name: upgrade-postgres
132+
securityContext:
133+
runAsUser: 0
134+
volumeMounts:
135+
- mountPath: /bitnami/postgresql
136+
name: YYY
137+
```
138+
139+
The value for `POSTGRES_PASSWORD` does not really matter, as it's never used in one-shot mode.
140+
115141
# For Developers
116142

117143
## Building the image

0 commit comments

Comments
 (0)