Skip to content

Commit

Permalink
feat: make pod securitycontext configurable in helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianluca755 authored and jonnyowenpowell committed Oct 1, 2024
1 parent 5191b13 commit e51de40
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
14 changes: 5 additions & 9 deletions snyk-monitor/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.securityContext.fsGroup }}
{{- with .Values.podSecurityContext }}
securityContext:
fsGroup: {{ int . }}
{{- toYaml . | nindent 8 }}
{{- end }}
affinity:
nodeAffinity:
Expand Down Expand Up @@ -250,14 +250,10 @@ spec:
exec:
command:
- "true"
{{- with .Values.snykMonitorSecurityContext }}
securityContext:
privileged: false
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: docker-config
secret:
Expand Down
14 changes: 11 additions & 3 deletions snyk-monitor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,17 @@ excludedNamespaces:
# template:
# spec:
# securityContext:
# fsGroup: <-- here
securityContext:
fsGroup:
# ... <-- here
podSecurityContext: {}

snykMonitorSecurityContext:
privileged: false
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL

# Set node tolerations for snyk-monitor
tolerations: []
Expand Down

0 comments on commit e51de40

Please sign in to comment.