2 # Copyright © 2020 Bitnami, AT&T, Amdocs, Bell Canada, highstreet technologies
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 {{ $role := "master" -}}
20 {{ $suffix := $role -}}
21 {{ $labels := (dict "role" $role "discovery" .Values.cluster_name) -}}
22 metadata: {{- include "common.resourceMetadata" (dict "suffix" $suffix "labels" $labels "dot" . )| nindent 2 }}
25 type: {{ .Values.updateStrategy.type }}
26 {{- if (eq "OnDelete" .Values.updateStrategy.type) }}
29 selector: {{- include "common.selectors" (dict "matchLabels" $labels "dot" .)| nindent 4 }}
30 serviceName: {{ include "common.fullname" . }}-master
31 replicas: {{ .Values.replicaCount }}
33 metadata: {{- include "common.templateMetadata" (dict "labels" $labels "dot" .) | nindent 6 }}
35 {{- include "common.imagePullSecrets" . | nindent 6 }}
36 {{- if .Values.affinity }}
37 affinity: {{- include "common.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
39 {{- if .Values.nodeSelector }}
40 nodeSelector: {{- include "common.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
42 {{- if .Values.tolerations }}
43 tolerations: {{- include "common.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
45 {{ include "common.podSecurityContext" . | indent 6 | trim }}
47 {{- if .Values.sysctlImage.enabled }}
48 ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
50 image: {{ include "repositoryGenerator.image.busybox" . }}
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 {{ include "common.containerSecurityContext" . | indent 10 | trim }}
68 - mountPath: /etc/sysctl.conf
72 - name: {{ include "common.name" . }}-config-copy
73 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
74 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
75 {{ include "common.containerSecurityContext" . | indent 10 | trim }}
87 cp -R /opt/bitnami/elasticsearch/config/. /opt/bitnami/elasticsearch/config_rw
89 - mountPath: /opt/bitnami/elasticsearch/config_rw
92 - name: {{ include "common.name" . }}-master
93 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
94 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
95 {{ include "common.containerSecurityContext" . | indent 10 | trim }}
98 value: {{ ternary "true" "false" .Values.debug | quote }}
99 - name: ELASTICSEARCH_CLUSTER_NAME
100 value: {{ .Values.cluster_name }}
101 - name: ELASTICSEARCH_CLUSTER_HOSTS
102 value: {{ include "common.name" . }}-discovery
103 - name: ELASTICSEARCH_CLUSTER_MASTER_HOSTS
104 {{- $elasticsearchMasterFullname := printf "%s-%s" (include "common.fullname" . ) "master" }}
105 {{- $replicas := int .Values.replicaCount }}
106 value: {{range $i, $e := until $replicas }}{{ $elasticsearchMasterFullname }}-{{ $e }} {{ end }}
107 - name: ELASTICSEARCH_MINIMUM_MASTER_NODES
108 value: {{ add (div .Values.replicaCount 2) 1 | quote }}
109 {{- if .Values.plugins }}
110 - name: ELASTICSEARCH_PLUGINS
111 value: {{ .Values.plugins | quote }}
113 - name: ELASTICSEARCH_HEAP_SIZE
114 value: {{ .Values.heapSize | quote }}
115 - name: ELASTICSEARCH_IS_DEDICATED_NODE
116 value: {{ .Values.dedicatednode | quote }}
117 - name: ELASTICSEARCH_NODE_TYPE
119 - name: network.bind_host
121 - name: network.publish_host
124 fieldPath: status.podIP
125 ports: {{- include "common.containerPorts" . |indent 12 }}
126 {{- if .Values.livenessProbe.enabled }}
128 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
129 periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
130 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
131 successThreshold: {{ .Values.livenessProbe.successThreshold }}
132 failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
134 path: /_cluster/health?local=true
137 {{- if .Values.readinessProbe.enabled }}
139 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
140 periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
141 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
142 successThreshold: {{ .Values.livenessProbe.successThreshold }}
143 failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
145 path: /_cluster/health?local=true
148 {{- if .Values.resources }}
149 resources: {{- toYaml .Values.resources | nindent 12 }}
154 - mountPath: /opt/bitnami/elasticsearch/logs
156 - mountPath: /opt/bitnami/elasticsearch/tmp
158 - mountPath: /opt/bitnami/elasticsearch/config
160 {{- if .Values.config }}
161 - mountPath: /opt/bitnami/elasticsearch/config/elasticsearch.yml
163 subPath: elasticsearch.yml
166 mountPath: /bitnami/elasticsearch/data
167 {{- if .Values.extraVolumeMounts }}
168 {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
173 name: {{ include "common.fullname" . }}
175 sizeLimit: {{ .Values.volumes.tmpSizeLimit }}
178 sizeLimit: {{ .Values.volumes.bitnamiLogsSizeLimit }}
181 sizeLimit: {{ .Values.volumes.bitnamiTmpSizeLimit }}
184 sizeLimit: {{ .Values.volumes.bitnamiConfigSizeLimit }}
186 {{- if .Values.extraVolumes }}
187 {{- toYaml .Values.extraVolumes | nindent 8 }}
189 {{- if not .Values.persistence.enabled }}
192 sizeLimit: {{ .Values.volumes.dataSizeLimit }}
194 volumeClaimTemplates:
197 {{- if .Values.persistence.annotations }}
198 annotations: {{- toYaml .Values.persistence.annotations | nindent 10 }}
202 - {{ .Values.persistence.accessMode }}
203 storageClassName: {{ include "common.storageClass" (dict "dot" . "suffix" .Values.persistence.suffix) }}
206 storage: {{ .Values.persistence.size | quote }}