Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit b45cf43

Browse files
committed
Introduce securityContext for operator
The `nonroot` user assignment was removed from the dockerfile as this was already set via the `:nonroot` tag. This user is already set using its uid. This allows the `runAsNonRoot` securityContext Flag to work correctly.
1 parent 3eb5a8c commit b45cf43

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

operator/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ ENV TELEMETRY_ENABLED "true"
2828

2929
WORKDIR /
3030
COPY --from=builder /workspace/manager .
31-
USER nonroot:nonroot
3231

3332
ENTRYPOINT ["/manager"]

operator/templates/manager/manager.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,6 @@ spec:
7777
value: {{ .Values.lurcher.image.pullPolicy }}
7878
resources:
7979
{{- toYaml .Values.resources | nindent 12 }}
80+
securityContext:
81+
{{- toYaml .Values.securityContext | nindent 12 }}
8082
terminationGracePeriodSeconds: 10

operator/values.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ image:
1212
# @default -- defaults to the charts version
1313
tag: null
1414
# image.pullPolicy -- Image pull policy
15-
pullPolicy: Always
15+
pullPolicy: IfNotPresent
16+
17+
securityContext:
18+
runAsNonRoot: true
19+
readOnlyRootFilesystem: true
20+
allowPrivilegeEscalation: false
21+
privileged: false
22+
capabilities:
23+
drop:
24+
- all
1625

1726
lurcher:
1827
image:

0 commit comments

Comments
 (0)