Skip to content

Commit 028b834

Browse files
knan-nrkFxKu
authored andcommitted
postgres-operator deployment template: run operator as non-root, and with readonly filesystem (zalando#582)
1 parent 35a1f2c commit 028b834

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docker/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ RUN apk --no-cache add ca-certificates
66

77
COPY build/* /
88

9+
RUN addgroup -g 1000 pgo
10+
RUN adduser -D -u 1000 -G pgo -g 'Postgres operator' pgo
11+
12+
USER 1000:1000
13+
914
ENTRYPOINT ["/postgres-operator"]

manifests/postgres-operator.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ spec:
2121
limits:
2222
cpu: 2000m
2323
memory: 500Mi
24+
securityContext:
25+
runAsUser: 1000
26+
runAsNonRoot: true
27+
readOnlyRootFilesystem: true
2428
env:
2529
# provided additional ENV vars can overwrite individual config map entries
2630
- name: CONFIG_MAP_NAME

0 commit comments

Comments
 (0)