From 3f91fd16e73341aad86828ea39f624ac99ff70ea Mon Sep 17 00:00:00 2001 From: Valeriano Manassero <14011549+valeriano-manassero@users.noreply.github.com> Date: Wed, 8 Feb 2023 15:46:43 +0100 Subject: [PATCH] Changed: elasticsearch connstring creation --- charts/clearml/templates/_helpers.tpl | 8 -------- charts/clearml/templates/apiserver-deployment.yaml | 14 ++++++++++---- charts/clearml/values.yaml | 7 +++---- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/charts/clearml/templates/_helpers.tpl b/charts/clearml/templates/_helpers.tpl index 4f1eddb..e818934 100644 --- a/charts/clearml/templates/_helpers.tpl +++ b/charts/clearml/templates/_helpers.tpl @@ -141,22 +141,14 @@ Create readiness probe auth token Elasticsearch Service name */}} {{- define "elasticsearch.servicename" -}} -{{- if .Values.elasticsearch.enabled }} {{- .Values.elasticsearch.clusterName }}-master -{{- else }} -{{- .Values.externalServices.elasticsearchHost }} -{{- end }} {{- end }} {{/* Elasticsearch Service port */}} {{- define "elasticsearch.serviceport" -}} -{{- if .Values.elasticsearch.enabled }} {{- .Values.elasticsearch.httpPort }} -{{- else }} -{{- .Values.externalServices.elasticsearchPort }} -{{- end }} {{- end }} {{/* diff --git a/charts/clearml/templates/apiserver-deployment.yaml b/charts/clearml/templates/apiserver-deployment.yaml index 1b34b65..d7b37dd 100644 --- a/charts/clearml/templates/apiserver-deployment.yaml +++ b/charts/clearml/templates/apiserver-deployment.yaml @@ -85,10 +85,12 @@ spec: containerPort: 8008 protocol: TCP env: - - name: CLEARML_ELASTIC_SERVICE_HOST - value: {{ include "elasticsearch.servicename" . }} - - name: CLEARML_ELASTIC_SERVICE_PORT - value: "{{ include "elasticsearch.serviceport" . }}" + - name: CLEARML__HOSTS__ELASTIC__WORKERS__HOSTS + {{- if .Values.elasticsearch.enabled }} + value: "[\"http://{{ include "elasticsearch.servicename" . }}:{{ include "elasticsearch.serviceport" . }}\"]" + {{- else }} + value: {{ .Values.externalServices.elasticsearchConnectionString | quote }} + {{- end }} {{- if .Values.mongodb.enabled }} - name: CLEARML_MONGODB_SERVICE_CONNECTION_STRING value: {{ include "mongodb.connectionstring" . | quote }} @@ -139,7 +141,11 @@ spec: - name: APPLY_ES_MAPPINGS value: "false" - name: CLEARML__HOSTS__ELASTIC__LOGS__HOSTS + {{- if .Values.elasticsearch.enabled }} value: "[\"http://{{ include "elasticsearch.servicename" . }}:{{ include "elasticsearch.serviceport" . }}\"]" + {{- else }} + value: {{ .Values.externalServices.elasticsearchConnectionString | quote }} + {{- end }} - name: NUMBER_OF_GUNICORN_WORKERS value: "{{ .Values.apiserver.processes.count }}" - name: GUNICORN_TIMEOUT diff --git a/charts/clearml/values.yaml b/charts/clearml/values.yaml index b172a29..7e22241 100644 --- a/charts/clearml/values.yaml +++ b/charts/clearml/values.yaml @@ -276,10 +276,9 @@ webserver: # -- Definition of external services to use if not enabled as dependency charts here externalServices: - # -- Existing ElasticSearch Hostname to use if elasticsearch.enabled is false - elasticsearchHost: "" - # -- Existing ElasticSearch Port to use if elasticsearch.enabled is false - elasticsearchPort: 9200 + # -- Existing ElasticSearch connectionstring if elasticsearch.enabled is false + elasticsearchConnectionString: "" + # [{"host":"hostname1","port":9200},{"host":"hostname2","port":9200},{"host":"hostname3","port":9200}] # -- Existing MongoDB connection string for BACKEND to use if mongodb.enabled is false mongodbConnectionStringAuth: "" # -- Existing MongoDB connection string for AUTH to use if mongodb.enabled is false