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 "elasticsearch.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: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536
66 {{ include "common.certInitializer.initContainer" . | nindent 8 }}
69 - name: {{ include "common.name" . }}-nginx
70 image: {{printf "%s/%s:%s" (include "common.repository" .) .Values.nginx.imageName .Values.nginx.tag }}
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.nginx.pullPolicy | quote }}
72 ports: {{- include "common.containerPorts" . | indent 12 -}}
73 {{- if .Values.nginx.livenessProbe }}
74 livenessProbe: {{- toYaml .Values.nginx.livenessProbe | nindent 12 }}
76 {{- if .Values.nginx.readinessProbe }}
77 readinessProbe: {{- toYaml .Values.nginx.readinessProbe | nindent 12 }}
79 {{- if .Values.nginx.resources }}
80 resources: {{- toYaml .Values.nginx.resources | nindent 12 }}
83 {{- if .Values.nginx.serverBlock }}
84 - name: nginx-server-block
85 mountPath: /opt/bitnami/nginx/conf/server_blocks
87 {{- include "common.certInitializer.volumeMount" . | nindent 10 }}
89 - name: {{ include "common.name" . }}-elasticsearch
90 image: {{ printf "%s/%s" (include "common.repository" .) .Values.image }}
91 {{- if .Values.securityContext.enabled }}
92 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
94 runAsUser: {{ .Values.securityContext.runAsUser }}
98 value: {{ ternary "true" "false" .Values.debug | quote }}
99 - name: ELASTICSEARCH_CLUSTER_NAME
100 value: {{ include "elasticsearch.clustername" .}}
101 - name: ELASTICSEARCH_CLUSTER_HOSTS
102 value: {{ include "common.name" . }}-discovery
103 {{- if .Values.plugins }}
104 - name: ELASTICSEARCH_PLUGINS
105 value: {{ .Values.plugins | quote }}
107 - name: ELASTICSEARCH_HEAP_SIZE
108 value: {{ .Values.heapSize | quote }}
109 - name: ELASTICSEARCH_IS_DEDICATED_NODE
111 - name: ELASTICSEARCH_NODE_TYPE
112 value: "coordinating"
113 - name: ELASTICSEARCH_PORT_NUMBER
115 {{/*ports: {{- include "common.containerPorts" . | indent 12 -}} */}}
116 {{- if .Values.livenessProbe.enabled }}
118 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
119 periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
120 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
121 successThreshold: {{ .Values.livenessProbe.successThreshold }}
122 failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
124 path: /_cluster/health?local=true
127 {{- if .Values.readinessProbe.enabled}}
129 initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
130 periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
131 timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
132 successThreshold: {{ .Values.readinessProbe.successThreshold }}
133 failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
135 path: /_cluster/health?local=true
138 {{- if .Values.resources }}
139 resources: {{- toYaml .Values.resources | nindent 12 }}
142 {{- if .Values.config }}
143 - mountPath: /opt/bitnami/elasticsearch/config/elasticsearch.yml
145 subPath: elasticsearch.yml
148 mountPath: "/bitnami/elasticsearch/data/"
149 {{- if .Values.extraVolumeMounts }}
150 {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
153 {{- if .Values.config }}
156 name: {{ include "common.fullname" . }}
160 {{- if .Values.extraVolumes }}
161 {{- toYaml .Values.extraVolumes | nindent 8 }}
163 {{- if .Values.nginx.serverBlock }}
164 - name: nginx-server-block
166 name: {{ include "common.fullname" . }}-nginx-server-block
168 {{ include "common.certInitializer.volumes" . | nindent 8 }}