Skip to content

Commit e906b2c

Browse files
committed
Allow to set a securityContext for spring-service helm charts
https://itdesign-de.atlassian.net/browse/KNUTH-124234
1 parent 0d1e634 commit e906b2c

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

charts/spring-service/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,7 @@ spec:
266266
- name: {{ $key }}
267267
{{ toYaml $value | indent 14 }}
268268
{{- end }}
269+
{{- if .Values.securityContext }}
270+
securityContext:
271+
{{ toYaml .Values.securityContext | indent 8 }}
272+
{{- end}}

charts/spring-service/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ disruptionBudget:
9999
# Set to false to disable service link environment variables
100100
enableServiceLinks: true
101101

102+
securityContext: { }
103+
102104
# Allow additional manifest to be deployed with the chart
103105
extraManifests: []
104106
# - apiVersion: v1

tests/spring-service/complex-service/expected/spring-service/templates/deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,8 @@ spec:
205205
- name: URLS
206206
value: https://mycompany.tld/url1 https://mycompany.tld/url2 https://mycompany.tld/url3
207207
https://mycompany.tld/url4
208+
securityContext:
209+
fsGroup: 2000
210+
runAsUser: 1000
211+
seccompProfile:
212+
type: RuntimeDefault

tests/spring-service/complex-service/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ disruptionBudget:
4444

4545
enableServiceLinks: false
4646

47+
securityContext:
48+
fsGroup: 2000
49+
runAsUser: 1000
50+
seccompProfile:
51+
type: RuntimeDefault
52+
4753
extraManifests:
4854
- apiVersion: v1
4955
kind: ConfigMap

0 commit comments

Comments
 (0)