Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #44 from mercedes-benz/fix/securitycontext
Browse files Browse the repository at this point in the history
chore: update pod security context configuration
  • Loading branch information
almadigabor authored Sep 1, 2023
2 parents 8722509 + a765162 commit 1f78790
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/daps-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.8.0
version: 1.8.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
6 changes: 6 additions & 0 deletions charts/daps-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "daps-server.serviceAccountName" . }}
{{- if .Values.podSecurityContext }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- end }}
initContainers:
- name: init-fill-pvc
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 10 }}
{{- end }}
command:
- "sh"
- "-c"
Expand Down Expand Up @@ -97,8 +101,10 @@ spec:
readOnly: false
containers:
- name: {{ .Chart.Name }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
Expand Down
10 changes: 6 additions & 4 deletions charts/daps-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ serviceAccount:
podAnnotations: {}

# -- Pod security context configuration
podSecurityContext: {}
# fsGroup: 2000
podSecurityContext:
podSecurityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000

# -- Pod security context configuration
securityContext:
Expand All @@ -73,8 +77,6 @@ securityContext:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
runAsUser: 1000

service:
# -- Service type
Expand Down

0 comments on commit 1f78790

Please sign in to comment.