Skip to content

Commit 6485f5d

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 6485f5d

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# spring-service
22

3+
## 5.3.0
4+
5+
- Allow to configure a `securityContext`
6+
37
## 5.2.0
48

59
- Allow to disable environment variable service links using `enableServiceLinks: false`

charts/spring-service/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
name: spring-service
33
description: A generalized deployment for Meisterplan Spring Boot services in Kubernetes.
4-
version: 5.2.0
4+
version: 5.3.0

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)