diff --git a/CHANGELOG.md b/CHANGELOG.md index 67e1550..a2eabde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # spring-service +## 5.3.0 + +- Allow to configure a `securityContext` + ## 5.2.0 - Allow to disable environment variable service links using `enableServiceLinks: false` diff --git a/charts/spring-service/Chart.yaml b/charts/spring-service/Chart.yaml index c2f5fd5..fe5c2c3 100644 --- a/charts/spring-service/Chart.yaml +++ b/charts/spring-service/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 name: spring-service description: A generalized deployment for Meisterplan Spring Boot services in Kubernetes. -version: 5.2.0 +version: 5.3.0 diff --git a/charts/spring-service/templates/deployment.yaml b/charts/spring-service/templates/deployment.yaml index 51a56f9..7089721 100644 --- a/charts/spring-service/templates/deployment.yaml +++ b/charts/spring-service/templates/deployment.yaml @@ -266,3 +266,7 @@ spec: - name: {{ $key }} {{ toYaml $value | indent 14 }} {{- end }} + {{- if .Values.securityContext }} + securityContext: +{{ toYaml .Values.securityContext | indent 12 }} + {{- end}} diff --git a/charts/spring-service/values.yaml b/charts/spring-service/values.yaml index 548b2ab..f3d0eb3 100644 --- a/charts/spring-service/values.yaml +++ b/charts/spring-service/values.yaml @@ -99,6 +99,8 @@ disruptionBudget: # Set to false to disable service link environment variables enableServiceLinks: true +securityContext: { } + # Allow additional manifest to be deployed with the chart extraManifests: [] # - apiVersion: v1 diff --git a/tests/spring-service/complex-service/expected/spring-service/templates/deployment.yaml b/tests/spring-service/complex-service/expected/spring-service/templates/deployment.yaml index 875bfb9..e537410 100644 --- a/tests/spring-service/complex-service/expected/spring-service/templates/deployment.yaml +++ b/tests/spring-service/complex-service/expected/spring-service/templates/deployment.yaml @@ -205,3 +205,7 @@ spec: - name: URLS value: https://mycompany.tld/url1 https://mycompany.tld/url2 https://mycompany.tld/url3 https://mycompany.tld/url4 + securityContext: + runAsUser: 1000 + seccompProfile: + type: RuntimeDefault diff --git a/tests/spring-service/complex-service/values.yaml b/tests/spring-service/complex-service/values.yaml index 8c88186..d14229b 100644 --- a/tests/spring-service/complex-service/values.yaml +++ b/tests/spring-service/complex-service/values.yaml @@ -44,6 +44,11 @@ disruptionBudget: enableServiceLinks: false +securityContext: + runAsUser: 1000 + seccompProfile: + type: RuntimeDefault + extraManifests: - apiVersion: v1 kind: ConfigMap