@@ -42,20 +42,25 @@ spec:
4242 {{- end }}
4343 automountServiceAccountToken : {{ .Values.app.automountServiceAccountToken }}
4444 initContainers :
45- - name : db-migrations
46- image : " {{ .Values.global.image.registry | default " docker.io" }}/{{ .Values.global.image.repository }}:{{ .Values.global.image.tag | default .Chart.AppVersion }}"
47- args : [ "label-studio-migrate" ]
48- imagePullPolicy : {{ .Values.global.image.pullPolicy }}
49- {{- if .Values.app.containerSecurityContext.enabled }}
50- securityContext : {{- omit .Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
45+ {{- if .Values.app.initContainers }}
46+ {{- range .Values.app.initContainers }}
47+ - name : {{ .name }}
48+ image : {{ or .image (printf "%s/%s:%s" ($.Values.global.image.registry | default "docker.io") $.Values.global.image.repository $.Values.global.image.tag) ($.Chart.AppVersion) }}
49+ args : {{- range .args }}
50+ - {{ . }}
51+ {{- end }}
52+ imagePullPolicy : {{ or .pullPolicy $.Values.global.image.pullPolicy }}
53+ {{- if .restartPolicy }}
54+ restartPolicy : {{ .restartPolicy }}
55+ {{- end }}
56+ {{- if $.Values.app.containerSecurityContext.enabled }}
57+ securityContext : {{- omit $.Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
5158 {{- end }}
52- resources :
53- {{- toYaml .Values.app.initContainer.resources | nindent 12 }}
5459 env :
55- {{- include "ls.common.envs" . | nindent 12 }}
60+ {{- include "ls.common.envs" $ | nindent 12 }}
5661 - name : INIT_CONTAINER
5762 value : " true"
58- {{- if .Values.app.debug }}
63+ {{- if $ .Values.app.debug }}
5964 - name : DEBUG
6065 value : " true"
6166 {{- end }}
@@ -66,33 +71,33 @@ spec:
6671 name : opt-heartex-init
6772 - mountPath : /tmp
6873 name : tmp-dir-init
69- {{- if .Values.global.pgConfig.ssl.pgSslSecretName }}
74+ {{- if $ .Values.global.pgConfig.ssl.pgSslSecretName }}
7075 - name : pg-ssl-certs
7176 mountPath : /opt/heartex/secrets/pg_certs
7277 {{- end }}
73- {{- if .Values.global.redisConfig.ssl.redisSslSecretName }}
78+ {{- if $ .Values.global.redisConfig.ssl.redisSslSecretName }}
7479 - name : redis-ssl-certs
7580 mountPath : /opt/heartex/secrets/redis_certs
7681 {{- end }}
77- {{- if .Values.app. extraVolumeMounts }}
78- {{ toYaml .Values.app. extraVolumeMounts | nindent 12 }}
82+ {{- if .extraVolumeMounts }}
83+ {{ toYaml .extraVolumeMounts | nindent 12 }}
7984 {{- end }}
80- {{- if .Values.app.initContainers }}
81- {{- range .Values.app.initContainers }}
82- - name : {{ .name }}
83- image : {{ or .image (printf "%s:%s" $.Values.global.image.repository $.Values.global.image.tag) ($.Chart.AppVersion) }}
84- args : {{- range .args }}
85- - {{ . }}
8685 {{- end }}
87- imagePullPolicy : {{ or .pullPolicy $.Values.global.image.pullPolicy }}
88- {{- if $.Values.app.containerSecurityContext.enabled }}
89- securityContext : {{- omit $.Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
9086 {{- end }}
87+ - name : db-migrations
88+ image : " {{ .Values.global.image.registry | default " docker.io" }}/{{ .Values.global.image.repository }}:{{ .Values.global.image.tag | default .Chart.AppVersion }}"
89+ args : [ "label-studio-migrate" ]
90+ imagePullPolicy : {{ .Values.global.image.pullPolicy }}
91+ {{- if .Values.app.containerSecurityContext.enabled }}
92+ securityContext : {{- omit .Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
93+ {{- end }}
94+ resources :
95+ {{- toYaml .Values.app.initContainer.resources | nindent 12 }}
9196 env :
92- {{- include "ls.common.envs" $ | nindent 12 }}
97+ {{- include "ls.common.envs" . | nindent 12 }}
9398 - name : INIT_CONTAINER
9499 value : " true"
95- {{- if $ .Values.app.debug }}
100+ {{- if .Values.app.debug }}
96101 - name : DEBUG
97102 value : " true"
98103 {{- end }}
@@ -103,19 +108,17 @@ spec:
103108 name : opt-heartex-init
104109 - mountPath : /tmp
105110 name : tmp-dir-init
106- {{- if $ .Values.global.pgConfig.ssl.pgSslSecretName }}
111+ {{- if .Values.global.pgConfig.ssl.pgSslSecretName }}
107112 - name : pg-ssl-certs
108113 mountPath : /opt/heartex/secrets/pg_certs
109114 {{- end }}
110- {{- if $ .Values.global.redisConfig.ssl.redisSslSecretName }}
115+ {{- if .Values.global.redisConfig.ssl.redisSslSecretName }}
111116 - name : redis-ssl-certs
112117 mountPath : /opt/heartex/secrets/redis_certs
113118 {{- end }}
114- {{- if .extraVolumeMounts }}
115- {{ toYaml .extraVolumeMounts | nindent 12 }}
119+ {{- if .Values.app. extraVolumeMounts }}
120+ {{ toYaml .Values.app. extraVolumeMounts | nindent 12 }}
116121 {{- end }}
117- {{- end }}
118- {{- end }}
119122 terminationGracePeriodSeconds : {{ .Values.app.terminationGracePeriodSeconds }}
120123 containers :
121124 - name : app
@@ -318,49 +321,7 @@ spec:
318321 - name : " uwsgimetrics"
319322 containerPort : 9117
320323 {{- end }}
321- {{- if .Values.app.sidecarContainers }}
322- {{- range .Values.app.sidecarContainers }}
323- - name : {{ .name }}
324- image : {{ .image }}
325- imagePullPolicy : {{ .imagePullPolicy | default "IfNotPresent" }}
326- {{- if .args }}
327- args : {{ .args }}
328- {{- end }}
329- {{- if .securityContext }}
330- securityContext : {{ toYaml .securityContext | nindent 12 }}
331- {{- end }}
332- env :
333- {{- include "ls.common.envs" $ | nindent 12 }}
334- {{- if .extraEnvironmentVars -}}
335- {{- range $key, $value := .extraEnvironmentVars }}
336- - name : {{ printf "%s" $key | replace "." "_" | upper | quote }}
337- value : {{ $value | quote }}
338- {{- end }}
339- {{- end }}
340- {{- if .extraEnvironmentSecrets -}}
341- {{- range $key, $value := .extraEnvironmentSecrets }}
342- - name : {{ printf "%s" $key | replace "." "_" | upper | quote }}
343- valueFrom :
344- secretKeyRef :
345- name : {{ $value.secretName }}
346- key : {{ $value.secretKey }}
347- {{- end }}
348- {{- end }}
349- {{- if .readinessProbe }}
350- readinessProbe : {{ toYaml .readinessProbe | nindent 12 }}
351- {{- end }}
352- {{- if .livenessProbe }}
353- livenessProbe : {{ toYaml .livenessProbe | nindent 12 }}
354- {{- end }}
355- resources :
356- {{- toYaml .resources | nindent 12 }}
357- volumeMounts :
358- {{- if .volumeMounts }}
359- {{ toYaml .volumeMounts | nindent 12 }}
360- {{- end }}
361- {{- end }}
362- {{- end }}
363- {{- with .Values.app.nodeSelector }}
324+ {{- with .Values.app.nodeSelector }}
364325 nodeSelector :
365326 {{- toYaml . | nindent 8 }}
366327 {{- end }}
0 commit comments