Skip to content

Commit e51de40

Browse files
Gianluca755jonnyowenpowell
authored andcommitted
feat: make pod securitycontext configurable in helm chart
1 parent 5191b13 commit e51de40

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

snyk-monitor/templates/deployment.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ spec:
3333
{{- toYaml . | nindent 8 }}
3434
{{- end }}
3535
spec:
36-
{{- with .Values.securityContext.fsGroup }}
36+
{{- with .Values.podSecurityContext }}
3737
securityContext:
38-
fsGroup: {{ int . }}
38+
{{- toYaml . | nindent 8 }}
3939
{{- end }}
4040
affinity:
4141
nodeAffinity:
@@ -250,14 +250,10 @@ spec:
250250
exec:
251251
command:
252252
- "true"
253+
{{- with .Values.snykMonitorSecurityContext }}
253254
securityContext:
254-
privileged: false
255-
runAsNonRoot: true
256-
allowPrivilegeEscalation: false
257-
readOnlyRootFilesystem: true
258-
capabilities:
259-
drop:
260-
- ALL
255+
{{- toYaml . | nindent 12 }}
256+
{{- end }}
261257
volumes:
262258
- name: docker-config
263259
secret:

snyk-monitor/values.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,17 @@ excludedNamespaces:
134134
# template:
135135
# spec:
136136
# securityContext:
137-
# fsGroup: <-- here
138-
securityContext:
139-
fsGroup:
137+
# ... <-- here
138+
podSecurityContext: {}
139+
140+
snykMonitorSecurityContext:
141+
privileged: false
142+
runAsNonRoot: true
143+
allowPrivilegeEscalation: false
144+
readOnlyRootFilesystem: true
145+
capabilities:
146+
drop:
147+
- ALL
140148

141149
# Set node tolerations for snyk-monitor
142150
tolerations: []

0 commit comments

Comments
 (0)