diff --git a/charts/superstream/templates/_helpers.tpl b/charts/superstream/templates/_helpers.tpl index 7bc2824..a497b4c 100644 --- a/charts/superstream/templates/_helpers.tpl +++ b/charts/superstream/templates/_helpers.tpl @@ -93,4 +93,10 @@ image: {{ $image }} {{- if or .pullPolicy .global.image.pullPolicy }} imagePullPolicy: {{ .pullPolicy | default .global.image.pullPolicy }} {{- end }} +{{- end }} + +{{- define "superstream.podSecurityContext" -}} +{{- if or .podSecurityContext .global.podSecurityContext -}} +{{ toYaml (.podSecurityContext | default .global.podSecurityContext) | nindent 4 -}} +{{- end }} {{- end }} \ No newline at end of file diff --git a/charts/superstream/templates/deployment-data-plane.yaml b/charts/superstream/templates/deployment-data-plane.yaml index 4cc7df0..a4c45dc 100644 --- a/charts/superstream/templates/deployment-data-plane.yaml +++ b/charts/superstream/templates/deployment-data-plane.yaml @@ -47,8 +47,8 @@ spec: {{- end }} {{- end }} serviceAccountName: {{ include "superstream.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.superstreamEngine.podSecurityContext | nindent 8 }} + securityContext: + {{- include "superstream.podSecurityContext" (merge (pick $.Values "global") .Values.superstreamEngine) | nindent 4 }} containers: - name: {{ .Chart.Name }}-data-plane {{ include "superstream.image" (merge (pick $.Values "global") .Values.superstreamEngine.image) | nindent 10 }} diff --git a/charts/superstream/templates/deployment-syslog.yaml b/charts/superstream/templates/deployment-syslog.yaml index 7ee9b43..7e2cd8c 100644 --- a/charts/superstream/templates/deployment-syslog.yaml +++ b/charts/superstream/templates/deployment-syslog.yaml @@ -28,7 +28,7 @@ spec: {{- end }} {{- end }} securityContext: - {{- toYaml .Values.syslog.podSecurityContext | nindent 8 }} + {{- include "superstream.podSecurityContext" (merge (pick $.Values "global") .Values.syslog) | nindent 4 }} containers: - name: syslog-ng {{ include "superstream.image" (merge (pick $.Values "global") .Values.syslog.image) | nindent 8 }} diff --git a/charts/superstream/values.yaml b/charts/superstream/values.yaml index 72b6461..a32225a 100644 --- a/charts/superstream/values.yaml +++ b/charts/superstream/values.yaml @@ -21,6 +21,10 @@ global: # global labels will be applied to all resources deployed by the chart labels: {} + podSecurityContext: {} + # runAsUser: 1000 + # runAsGroup: 1000 + # fsGroup: 2000 ############################################################ # NATS config @@ -96,7 +100,7 @@ superstreamEngine: prometheus.io/scrape: 'true' prometheus.io/port: "7777" podSecurityContext: {} - # fsGroup: 2000 + # fsGroup: 2000 securityContext: {} # capabilities: