Merge "[DCAEMOD] Uses new tpls for repos / images"
[oom.git] / kubernetes / common / elasticsearch / templates / _helpers.tpl
1 {{/*
2 # Copyright © 2020 Bitnami, AT&T, Amdocs, Bell Canada, highstreet technologies
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 */}}
16 {{/* vim: set filetype=mustache: */}}
17 {{/*
18 Expand the name of the chart.
19 */}}
20
21
22 {{ define "elasticsearch.clustername"}}
23 {{- printf "%s-%s" (include "common.name" .) "cluster" -}}
24 {{- end -}}
25
26 {{/*
27 This define should be used instead of "common.fullname" to allow
28 special handling of kibanaEnabled=true
29 Create a default fully qualified coordinating name.
30 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
31 */}}
32 {{- define "elasticsearch.coordinating.fullname" -}}
33 {{- if .Values.global.kibanaEnabled -}}
34 {{- printf "%s-%s" .Release.Name .Values.global.coordinating.name | trunc 63 | trimSuffix "-" -}}
35 {{- else -}}
36 {{- printf "%s-%s" (include "common.fullname" .) .Values.global.coordinating.name | trunc 63 | trimSuffix "-" -}}
37 {{- end -}}
38 {{- end -}}
39
40 {{/*
41  Create the name of the master service account to use
42  */}}
43 {{- define "elasticsearch.master.serviceAccountName" -}}
44 {{- if .Values.master.serviceAccount.create -}}
45     {{ default (include "common.fullname" (dict "suffix" "master" "dot" .)) .Values.master.serviceAccount.name }}
46 {{- else -}}
47     {{ default "default" .Values.master.serviceAccount.name }}
48 {{- end -}}
49 {{- end -}}
50
51 {{/*
52  Create the name of the coordinating-only service account to use
53  */}}
54 {{- define "elasticsearch.serviceAccountName" -}}
55 {{- if .Values.serviceAccount.create -}}
56     {{ default (include "common.fullname" . ) .Values.serviceAccount.name }}
57 {{- else -}}
58     {{ default "default" .Values.serviceAccount.name }}
59 {{- end -}}
60 {{- end -}}
61
62 {{/*
63  Create the name of the data service account to use
64  */}}
65 {{- define "elasticsearch.data.serviceAccountName" -}}
66 {{- if .Values.serviceAccount.create -}}
67     {{ default (include "common.fullname" (dict "suffix" "data" "dot" .)) .Values.data.serviceAccount.name }}
68 {{- else -}}
69     {{ default "default" .Values.serviceAccount.name }}
70 {{- end -}}
71 {{- end -}}
72
73