Jakub Latusek | 3659d9f | 2020-09-14 16:21:55 +0200 | [diff] [blame^] | 1 | {{/* |
Alexander Dehn | ab86ec1 | 2020-02-05 14:38:54 +0000 | [diff] [blame] | 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. |
Jakub Latusek | 3659d9f | 2020-09-14 16:21:55 +0200 | [diff] [blame^] | 15 | */}} |
Alexander Dehn | ab86ec1 | 2020-02-05 14:38:54 +0000 | [diff] [blame] | 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 | |
| 74 | {{/* |
| 75 | Return the proper Docker Image Registry Secret Names |
| 76 | */}} |
| 77 | {{- define "elasticsearch.imagePullSecrets" -}} |
| 78 | {{- if .Values.global }} |
| 79 | {{- if .Values.global.imagePullSecrets }} |
| 80 | imagePullSecrets: |
| 81 | {{- range .Values.global.imagePullSecrets }} |
| 82 | - name: {{ . }} |
| 83 | {{- end }} |
| 84 | {{- end }} |
| 85 | {{- else }} |
| 86 | {{- $imagePullSecrets := coalesce .Values.image.pullSecrets .Values.metrics.image.pullSecrets .Values.curator.image.pullSecrets .Values.sysctlImage.pullSecrets .Values.volumePermissions.image.pullSecrets -}} |
| 87 | {{- if $imagePullSecrets }} |
| 88 | imagePullSecrets: |
| 89 | {{- range $imagePullSecrets }} |
| 90 | - name: {{ . }} |
| 91 | {{- end -}} |
| 92 | {{- end -}} |
| 93 | {{- end -}} |
| 94 | {{- end -}} |
| 95 | |
| 96 | {{/* |
| 97 | Create the name of the service account to use |
| 98 | */}} |
| 99 | {{- define "elasticsearch.curator.serviceAccountName" -}} |
| 100 | {{- if .Values.curator.serviceAccount.create -}} |
| 101 | {{ default (include "common.fullname" (dict "suffix" "currator" "dot" .)) .Values.curator.serviceAccount.name }} |
| 102 | {{- else -}} |
| 103 | {{ default "default" .Values.curator.serviceAccount.name }} |
| 104 | {{- end -}} |
| 105 | {{- end -}} |