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.
18 {{ $role := "coordinating-only" -}}
19 {{ $suffix := $role -}}
20 {{ $labels := (dict "role" $role "discovery" (include "elasticsearch.clustername" .)) -}}
21 metadata: {{- include "common.resourceMetadata" (dict "suffix" $suffix "labels" $labels "dot" . )| nindent 2 }}
24 type: {{ .Values.updateStrategy.type }}
25 {{- if (eq "Recreate" .Values.updateStrategy.type) }}
28 selector: {{- include "common.selectors" (dict "matchLabels" $labels "dot" .) | nindent 4 }}
29 replicas: {{ .Values.replicaCount }}
31 metadata: {{- include "common.templateMetadata" (dict "labels" $labels "dot" .) | nindent 6 }}
33 {{- include "common.imagePullSecrets" . | nindent 6 }}
34 {{- if .Values.affinity }}
35 affinity: {{- include "common.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
37 {{- if .Values.nodeSelector }}
38 nodeSelector: {{- include "common.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
40 {{- if .Values.tolerations }}
41 tolerations: {{- include "common.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
43 serviceAccountName: {{ template "elasticsearch.serviceAccountName" . }}
44 {{- if .Values.securityContext.enabled }}
46 fsGroup: {{ .Values.securityContext.fsGroup }}
49 ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
51 {{- if .Values.sysctlImage.enabled }}
53 image: {{ include "repositoryGenerator.image.busybox" . }}
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536
68 - name: {{ include "common.name" . }}-nginx
69 image: {{ include "repositoryGenerator.image.nginx" . }}
70 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.nginx.pullPolicy | quote }}
71 ports: {{- include "common.containerPorts" . | indent 12 -}}
72 {{- if .Values.nginx.livenessProbe }}
73 livenessProbe: {{- toYaml .Values.nginx.livenessProbe | nindent 12 }}
75 {{- if .Values.nginx.readinessProbe }}
76 readinessProbe: {{- toYaml .Values.nginx.readinessProbe | nindent 12 }}
78 {{- if .Values.nginx.resources }}
79 resources: {{- toYaml .Values.nginx.resources | nindent 12 }}
82 {{- if .Values.nginx.serverBlock }}
83 - name: nginx-server-block
84 mountPath: /opt/bitnami/nginx/conf/server_blocks
87 - name: {{ include "common.name" . }}-elasticsearch
88 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
89 {{- if .Values.securityContext.enabled }}
90 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
92 runAsUser: {{ .Values.securityContext.runAsUser }}
96 value: {{ ternary "true" "false" .Values.debug | quote }}
97 - name: ELASTICSEARCH_CLUSTER_NAME
98 value: {{ include "elasticsearch.clustername" .}}
99 - name: ELASTICSEARCH_CLUSTER_HOSTS
100 value: {{ include "common.name" . }}-discovery
101 {{- if .Values.plugins }}
102 - name: ELASTICSEARCH_PLUGINS
103 value: {{ .Values.plugins | quote }}
105 - name: ELASTICSEARCH_HEAP_SIZE
106 value: {{ .Values.heapSize | quote }}
107 - name: ELASTICSEARCH_IS_DEDICATED_NODE
109 - name: ELASTICSEARCH_NODE_TYPE
110 value: "coordinating"
111 - name: ELASTICSEARCH_PORT_NUMBER
113 - name: network.bind_host
115 - name: network.publish_host
118 fieldPath: status.podIP
119 {{/*ports: {{- include "common.containerPorts" . | indent 12 -}} */}}
120 {{- if .Values.livenessProbe.enabled }}
122 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
123 periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
124 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
125 successThreshold: {{ .Values.livenessProbe.successThreshold }}
126 failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
128 path: /_cluster/health?local=true
131 {{- if .Values.readinessProbe.enabled}}
133 initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
134 periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
135 timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
136 successThreshold: {{ .Values.readinessProbe.successThreshold }}
137 failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
139 path: /_cluster/health?local=true
142 {{- if .Values.resources }}
143 resources: {{- toYaml .Values.resources | nindent 12 }}
146 {{- if .Values.config }}
147 - mountPath: /opt/bitnami/elasticsearch/config/elasticsearch.yml
149 subPath: elasticsearch.yml
152 mountPath: "/bitnami/elasticsearch/data/"
153 {{- if .Values.extraVolumeMounts }}
154 {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
157 {{- if .Values.config }}
160 name: {{ include "common.fullname" . }}
164 {{- if .Values.extraVolumes }}
165 {{- toYaml .Values.extraVolumes | nindent 8 }}
167 {{- if .Values.nginx.serverBlock }}
168 - name: nginx-server-block
170 name: {{ include "common.fullname" . }}-nginx-server-block