@@ -5,6 +5,9 @@ metadata:
55 labels :
66 {{- include "retool.labels" . | nindent 4 }}
77 {{- include "retool.selectorLabels" . | nindent 4 }}
8+ {{- if .Values.deployment.labels }}
9+ {{ toYaml .Values.deployment.labels | indent 4 }}
10+ {{- end }}
811{{- if .Values.deployment.annotations }}
912 annotations :
1013{{ toYaml .Values.deployment.annotations | indent 4 }}
@@ -74,23 +77,27 @@ spec:
7477 value : {{ template "retool.deploymentTemplateVersion" . }}
7578 - name : NODE_ENV
7679 value : production
77- {{- if include "retool.jobRunner.enabled" . }}
78- {{ if $.Values.dbconnector.java.enabled }}
79- - name : SERVICE_TYPE
80- value : MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JAVA_DBCONNECTOR
81- {{ else }}
82- - name : SERVICE_TYPE
83- value : MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR
84- {{ end }}
85- {{- else }}
86- {{ if $.Values.dbconnector.java.enabled }}
87- - name : SERVICE_TYPE
88- value : MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JAVA_DBCONNECTOR,JOBS_RUNNER
89- {{ else }}
80+ {{- $serviceType := list "MAIN_BACKEND" "DB_CONNECTOR" "DB_SSH_CONNECTOR" }}
81+ {{- /*
82+ JAVA_DBCONNECTOR in the service type only applies before the version of Retool that changes it to opt-out (3.93.0-edge),
83+ and only if the Java dbconnector is enabled in values.yaml.
84+ */}}
85+ {{- if and ( not ( include "retool_version_with_java_dbconnector_opt_out" . ) ) ( $.Values.dbconnector.java.enabled ) }}
86+ {{- $serviceType = append $serviceType "JAVA_DBCONNECTOR" }}
87+ {{- end }}
88+ {{- /*
89+ It may seem counterintuitive to add the JOBS_RUNNER service type only without a jobs runner.
90+ The reason for this is that the backend needs to act as a jobs runner, if the jobs runner is not enabled.
91+ */}}
92+ {{- if not ( include "retool.jobRunner.enabled" . ) }}
93+ {{- $serviceType = append $serviceType "JOBS_RUNNER" }}
94+ {{- end }}
9095 - name : SERVICE_TYPE
91- value : MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER
96+ value : {{ join "," $serviceType }}
97+ {{ if and ( include "retool_version_with_java_dbconnector_opt_out" . ) ( not $.Values.dbconnector.java.enabled ) }}
98+ - name : DISABLE_JAVA_DBCONNECTOR
99+ value : " true"
92100 {{ end }}
93- {{- end }}
94101 - name : CLIENT_ID
95102 value : {{ default "" .Values.config.auth.google.clientId }}
96103 - name : COOKIE_INSECURE
@@ -263,6 +270,12 @@ spec:
263270 successThreshold : {{ .Values.readinessProbe.successThreshold }}
264271 periodSeconds : {{ .Values.readinessProbe.periodSeconds }}
265272{{- end }}
273+ {{- if .Values.preStopHook.enabled }}
274+ lifecycle :
275+ preStop :
276+ exec :
277+ command : ["sleep", "30"]
278+ {{- end }}
266279{{- if .Values.startupProbe.enabled }}
267280 startupProbe :
268281 httpGet :
@@ -295,6 +308,10 @@ spec:
295308 - name : {{ .name }}
296309 mountPath : {{ .mountPath }}
297310 subPath : {{ .subPath }}
311+ {{- end }}
312+ {{- if .Values.securityContext.extraContainerSecurityContext }}
313+ securityContext :
314+ {{ toYaml .Values.securityContext.extraContainerSecurityContext | indent 10 }}
298315{{- end }}
299316 {{- if .Values.image.pullSecrets }}
300317 imagePullSecrets :
@@ -314,6 +331,9 @@ spec:
314331 securityContext :
315332 runAsUser : {{ .Values.securityContext.runAsUser }}
316333 fsGroup : {{ .Values.securityContext.fsGroup }}
334+ {{- if .Values.securityContext.extraSecurityContext }}
335+ {{ toYaml .Values.securityContext.extraSecurityContext | indent 8 }}
336+ {{- end }}
317337{{- end }}
318338 volumes :
319339{{- range .Values.extraConfigMapMounts }}
0 commit comments