From 6e24b84bc3e6acc090efb27a88bf9273d757bef5 Mon Sep 17 00:00:00 2001 From: Yurii Vlasov Date: Fri, 27 Dec 2024 15:08:32 +0200 Subject: [PATCH] Fixing securityContext values injection. --- charts/chatwoot/templates/web-deployment.yaml | 15 ++++++++++----- charts/chatwoot/templates/worker-deployment.yaml | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/charts/chatwoot/templates/web-deployment.yaml b/charts/chatwoot/templates/web-deployment.yaml index 277520d..3a1e96e 100644 --- a/charts/chatwoot/templates/web-deployment.yaml +++ b/charts/chatwoot/templates/web-deployment.yaml @@ -41,7 +41,9 @@ spec: nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} containers: - - args: + - name: {{ .Chart.Name }}-web + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + args: - bundle - exec - rails @@ -74,8 +76,10 @@ spec: - secretRef: name: {{ .Values.existingEnvSecret }} {{- end }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - name: {{ .Chart.Name }}-web + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} ports: - containerPort: {{ int .Values.services.internalPort }} imagePullPolicy: {{ .Values.image.pullPolicy }} @@ -87,8 +91,9 @@ spec: - name: cache mountPath: /app/tmp serviceAccountName: {{ include "chatwoot.serviceAccountName" . }} - {{- if .Values.securityContext }} - securityContext: {{ .Values.securityContext | toYaml | nindent 8 }} + {{- with .Values.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} {{- end }} volumes: - name: cache diff --git a/charts/chatwoot/templates/worker-deployment.yaml b/charts/chatwoot/templates/worker-deployment.yaml index 1e55b19..f316915 100644 --- a/charts/chatwoot/templates/worker-deployment.yaml +++ b/charts/chatwoot/templates/worker-deployment.yaml @@ -41,7 +41,9 @@ spec: nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} containers: - - args: + - name: {{ .Chart.Name }}-workers + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + args: - bundle - exec - sidekiq @@ -69,8 +71,10 @@ spec: - secretRef: name: {{ .Values.existingEnvSecret }} {{- end }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - name: {{ .Chart.Name }}-workers + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.worker.resources }} resources: {{- toYaml . | nindent 12 }} @@ -80,8 +84,9 @@ spec: - name: cache mountPath: /app/tmp serviceAccountName: {{ include "chatwoot.serviceAccountName" . }} - {{- if .Values.securityContext }} - securityContext: {{ .Values.securityContext | toYaml | nindent 8 }} + {{- with .Values.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} {{- end }} volumes: - name: cache