From bed2332f6af679222f07e911e1c4b618fb8c0ffb Mon Sep 17 00:00:00 2001 From: jjlgao Date: Tue, 5 Dec 2023 13:36:48 -0800 Subject: [PATCH] [chore] Adds the JAVA_DBCONNECTOR service type (#133) --- charts/retool/Chart.yaml | 2 +- .../retool/templates/deployment_backend.yaml | 86 +++++++++++-------- .../templates/deployment_workflows.yaml | 7 +- charts/retool/values.yaml | 6 ++ values.yaml | 6 ++ 5 files changed, 67 insertions(+), 40 deletions(-) diff --git a/charts/retool/Chart.yaml b/charts/retool/Chart.yaml index 19794ca9..55c0de4e 100644 --- a/charts/retool/Chart.yaml +++ b/charts/retool/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: retool description: A Helm chart for Kubernetes type: application -version: 6.0.7 +version: 6.0.8 maintainers: - name: Retool Engineering email: engineering+helm@retool.com diff --git a/charts/retool/templates/deployment_backend.yaml b/charts/retool/templates/deployment_backend.yaml index 215b7f00..3fea3435 100644 --- a/charts/retool/templates/deployment_backend.yaml +++ b/charts/retool/templates/deployment_backend.yaml @@ -39,7 +39,7 @@ spec: {{- with .Values.hostAliases }} hostAliases: {{ toYaml . | indent 8 }} - {{- end }} + {{- end }} {{- if .Values.initContainers }} initContainers: {{- range $key, $value := .Values.initContainers }} @@ -62,11 +62,21 @@ spec: - name: NODE_ENV value: production {{- if include "retool.jobRunner.enabled" . }} + {{ if "$.Values.dbconnector.java.enabled" }} + - name: SERVICE_TYPE + value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JAVA_DBCONNECTOR + {{ else }} - name: SERVICE_TYPE value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR + {{ end }} {{- else }} + {{ if "$.Values.dbconnector.java.enabled" }} + - name: SERVICE_TYPE + value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JAVA_DBCONNECTOR,JOBS_RUNNER + {{ else }} - name: SERVICE_TYPE value: MAIN_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JOBS_RUNNER + {{ end }} {{- end }} - name: CLIENT_ID value: {{ default "" .Values.config.auth.google.clientId }} @@ -82,43 +92,43 @@ spec: value: {{ template "retool.postgresql.user" . }} - name: POSTGRES_SSL_ENABLED value: {{ template "retool.postgresql.ssl_enabled" . }} - {{- if .Values.config.dbConnectorTimeout }} - - name: DBCONNECTOR_QUERY_TIMEOUT_MS - value: {{ .Values.config.dbConnectorTimeout | quote }} + {{- if .Values.config.dbConnectorTimeout }} + - name: DBCONNECTOR_QUERY_TIMEOUT_MS + value: {{ .Values.config.dbConnectorTimeout | quote }} {{- end }} {{- if and (include "retool.workflows.enabled" .) (or (index .Values "retool-temporal-services-helm" "enabled") (.Values.workflows.temporal.enabled)) }} - - name: WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_HOST - value: {{ template "retool.temporal.host" . }} - - name: WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_PORT - value: {{ template "retool.temporal.port" . }} - - name: WORKFLOW_TEMPORAL_CLUSTER_NAMESPACE - value: {{ template "retool.temporal.namespace" . }} - {{- end }} + - name: WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_HOST + value: {{ template "retool.temporal.host" . }} + - name: WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_PORT + value: {{ template "retool.temporal.port" . }} + - name: WORKFLOW_TEMPORAL_CLUSTER_NAMESPACE + value: {{ template "retool.temporal.namespace" . }} + {{- end }} {{- if include "retool.workflows.enabled" . }} - - name: WORKFLOW_BACKEND_HOST - value: http://{{ template "retool.fullname" . }}-workflow-backend - {{- end }} - {{- if (.Values.workflows.temporal).sslEnabled }} - - name: WORKFLOW_TEMPORAL_TLS_ENABLED - value: "true" - {{- if (and (.Values.workflows.temporal).sslCert (.Values.workflows.temporal).sslKey) }} - - name: WORKFLOW_TEMPORAL_TLS_CRT - value: {{ .Values.workflows.temporal.sslCert }} - - name: WORKFLOW_TEMPORAL_TLS_KEY - valueFrom: - secretKeyRef: - {{- if (.Values.workflows.temporal).sslKeySecretName }} - name: {{ .Values.workflows.temporal.sslKeySecretName }} - key: {{ .Values.workflows.temporal.sslKeySecretKey | default "temporal-tls-key" }} - {{- else }} - name: {{ template "retool.fullname" . }} - key: "temporal-tls-key" - {{- end }} - {{- end }} - {{- end }} - {{- if .Values.codeExecutor.enabled }} - - name: CODE_EXECUTOR_INGRESS_DOMAIN - value: http://{{ template "retool.codeExecutor.name" . }} + - name: WORKFLOW_BACKEND_HOST + value: http://{{ template "retool.fullname" . }}-workflow-backend + {{- end }} + {{- if (.Values.workflows.temporal).sslEnabled }} + - name: WORKFLOW_TEMPORAL_TLS_ENABLED + value: "true" + {{- if (and (.Values.workflows.temporal).sslCert (.Values.workflows.temporal).sslKey) }} + - name: WORKFLOW_TEMPORAL_TLS_CRT + value: {{ .Values.workflows.temporal.sslCert }} + - name: WORKFLOW_TEMPORAL_TLS_KEY + valueFrom: + secretKeyRef: + {{- if (.Values.workflows.temporal).sslKeySecretName }} + name: {{ .Values.workflows.temporal.sslKeySecretName }} + key: {{ .Values.workflows.temporal.sslKeySecretKey | default "temporal-tls-key" }} + {{- else }} + name: {{ template "retool.fullname" . }} + key: "temporal-tls-key" + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.codeExecutor.enabled }} + - name: CODE_EXECUTOR_INGRESS_DOMAIN + value: http://{{ template "retool.codeExecutor.name" . }} {{- end }} {{- if and (not .Values.externalSecrets.enabled) (not .Values.externalSecrets.externalSecretsOperator.enabled) }} - name: LICENSE_KEY @@ -201,9 +211,9 @@ spec: envFrom: - secretRef: name: {{ .Values.externalSecrets.name }} - {{- range .Values.externalSecrets.secrets }} - - secretRef: - name: {{ .name }} + {{- range .Values.externalSecrets.secrets }} + - secretRef: + name: {{ .name }} {{- end }} {{- end }} {{- if .Values.externalSecrets.externalSecretsOperator.enabled }} diff --git a/charts/retool/templates/deployment_workflows.yaml b/charts/retool/templates/deployment_workflows.yaml index 76d962d7..cc2186cb 100644 --- a/charts/retool/templates/deployment_workflows.yaml +++ b/charts/retool/templates/deployment_workflows.yaml @@ -59,8 +59,13 @@ spec: env: - name: NODE_ENV value: production + {{ if "$.Values.dbconnector.java.enabled" }} - name: SERVICE_TYPE - value: DB_CONNECTOR,DB_SSH_CONNECTOR,WORKFLOW_BACKEND + value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR,JAVA_DBCONNECTOR + {{ else }} + - name: SERVICE_TYPE + value: WORKFLOW_BACKEND,DB_CONNECTOR,DB_SSH_CONNECTOR + {{ end }} - name: DBCONNECTOR_POSTGRES_POOL_MAX_SIZE value: "100" - name: DBCONNECTOR_QUERY_TIMEOUT_MS diff --git a/charts/retool/values.yaml b/charts/retool/values.yaml index a661d4c6..def64bc7 100644 --- a/charts/retool/values.yaml +++ b/charts/retool/values.yaml @@ -392,6 +392,12 @@ workflows: cpu: 1000m memory: 2048Mi +dbconnector: + java: + # Enable this to use Retool's experimental next-gen dbconnector to connect to resources. + # This feature is not ready for production use; please check with the Retool team before enablement. + enabled: false + codeExecutor: # Enable this for Python support and running code more securely within a separate # sandboxed environment diff --git a/values.yaml b/values.yaml index a661d4c6..def64bc7 100644 --- a/values.yaml +++ b/values.yaml @@ -392,6 +392,12 @@ workflows: cpu: 1000m memory: 2048Mi +dbconnector: + java: + # Enable this to use Retool's experimental next-gen dbconnector to connect to resources. + # This feature is not ready for production use; please check with the Retool team before enablement. + enabled: false + codeExecutor: # Enable this for Python support and running code more securely within a separate # sandboxed environment