Changed: elasticsearch connstring creation

This commit is contained in:
Valeriano Manassero 2023-02-08 15:46:43 +01:00
parent 9fc2b7ddda
commit 3f91fd16e7
3 changed files with 13 additions and 16 deletions

View File

@ -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 }}
{{/*

View File

@ -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

View File

@ -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