Skip to content

Commit 36db3ee

Browse files
authored
chore: update the Elasticsearch hosts dependnign of the cluster configuration. (#9530)
Signed-off-by: Jérémy Audiger <jeremy.audiger@ioterop.com>
1 parent c041b64 commit 36db3ee

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

bitnami/elasticsearch/templates/_helpers.tpl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,20 @@ Return the hostname of every ElasticSearch seed node
5656
{{- define "elasticsearch.hosts" -}}
5757
{{- $clusterDomain := .Values.clusterDomain }}
5858
{{- $releaseNamespace := .Release.Namespace }}
59+
{{- if gt (.Values.master.replicas | int) 0 }}
5960
{{- $masterFullname := include "elasticsearch.master.fullname" . }}
60-
{{- $coordinatingFullname := include "elasticsearch.coordinating.fullname" . }}
61-
{{- $dataFullname := include "elasticsearch.data.fullname" . }}
62-
{{- $ingestFullname := include "elasticsearch.ingest.fullname" . }}
6361
{{- $masterFullname }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }},
62+
{{- end -}}
63+
{{- if gt (.Values.coordinating.replicas | int) 0 }}
64+
{{- $coordinatingFullname := include "elasticsearch.coordinating.fullname" . }}
6465
{{- $coordinatingFullname }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }},
66+
{{- end -}}
67+
{{- if gt (.Values.data.replicas | int) 0 }}
68+
{{- $dataFullname := include "elasticsearch.data.fullname" . }}
6569
{{- $dataFullname }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }},
66-
{{- if .Values.ingest.enabled }}
70+
{{- end -}}
71+
{{- if and (eq .Values.ingest.enabled true) (gt (.Values.ingest.replicas | int) 0) }}
72+
{{- $ingestFullname := include "elasticsearch.ingest.fullname" . }}
6773
{{- $ingestFullname }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }},
6874
{{- end -}}
6975
{{- end -}}
@@ -498,4 +504,4 @@ DESIRED="{{ .value }}";
498504
if [ "$DESIRED" -gt "$CURRENT" ]; then
499505
sysctl -w {{ .key }}={{ .value }};
500506
fi;
501-
{{- end -}}
507+
{{- end -}}

0 commit comments

Comments
 (0)