Skip to content

Commit 6ef5c6c

Browse files
committed
helm: Fix containerSecurityContext to run PostgreSQL as non-root.
Fixes: #470.
1 parent 3811f14 commit 6ef5c6c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

kubernetes/chart/zulip/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ Now you're ready to follow [the installation instructions above](#installation).
9696
| postgresql.auth.username | string | `"zulip"` | |
9797
| postgresql.image.repository | string | `"zulip/zulip-postgresql"` | |
9898
| postgresql.image.tag | int | `14` | |
99-
| postgresql.primary.containerSecurityContext.runAsUser | int | `0` | |
99+
| postgresql.primary.containerSecurityContext.readOnlyRootFilesystem | bool | `false` | |
100+
| postgresql.primary.containerSecurityContext.runAsGroup | int | `70` | |
101+
| postgresql.primary.containerSecurityContext.runAsUser | int | `70` | |
100102
| rabbitmq.auth.username | string | `"zulip"` | |
101103
| rabbitmq.persistence.enabled | bool | `false` | |
102104
| redis.architecture | string | `"standalone"` | |

kubernetes/chart/zulip/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ sidecars: []
200200
postgresql:
201201
primary:
202202
containerSecurityContext:
203-
runAsUser: 0
203+
# 70 is the standard uid/gid of the "postgres" user in Alpine, which is
204+
# used as the base for zulip/zulip-postgresql
205+
# https://github.com/docker-library/postgres/blob/23987751b63ce745bd27b1119ab29dc4a1ffd728/Dockerfile-alpine.template#L7
206+
runAsUser: 70
207+
runAsGroup: 70
208+
readOnlyRootFilesystem: false
204209
## We need to override the Postgresql image to get all the plugins Zulip needs
205210
image:
206211
repository: zulip/zulip-postgresql

0 commit comments

Comments
 (0)