Skip to content

Commit

Permalink
Merge pull request #71 from phandox/main
Browse files Browse the repository at this point in the history
[feat] Add support for configuring SecurityContext via Helm chart
  • Loading branch information
mr-karan authored Feb 22, 2024
2 parents b3a5468 + 67ee00f commit 0dd4b97
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contrib/helm/calert/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ spec:
{{- end }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
{{- if .Values.securityContext.enabled }}
{{- with omit .Values.securityContext "enabled" }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand All @@ -37,6 +43,12 @@ spec:
{{- range .Values.args }}
- {{ . | quote }}
{{- end }}
{{- if .Values.securityContext.enabled }}
{{- with omit .Values.securityContext "enabled" "runAsGroup" "runAsUser" "runAsNonRoot" "windowsOptions" }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
ports:
- containerPort: {{ .Values.service.port }}
protocol: TCP
Expand Down
17 changes: 17 additions & 0 deletions contrib/helm/calert/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,20 @@ affinity: {}
topologySpreadConstraints: []

podAnnotations: {}

securityContext:
enabled: false

privileged: false
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1001
runAsGroup: 1001
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
windowsOptions:
hostProcess: false
capabilities:
drop: ["ALL"]
add: ["NET_BIND_SERVICE"]

0 comments on commit 0dd4b97

Please sign in to comment.