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 }}
34 - name: "{{ include "common.namespace" . }}-docker-registry-key"
35 {{- if .Values.affinity }}
36 affinity: {{- include "common.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
38 {{- if .Values.nodeSelector }}
39 nodeSelector: {{- include "common.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
41 {{- if .Values.tolerations }}
42 tolerations: {{- include "common.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
44 serviceAccountName: {{ template "elasticsearch.serviceAccountName" . }}
45 {{- if .Values.securityContext.enabled }}
47 fsGroup: {{ .Values.securityContext.fsGroup }}
50 ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
52 {{- if .Values.sysctlImage.enabled }}
54 image: {{ include "repositoryGenerator.image.busybox" . }}
55 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63 sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536
67 {{ include "common.certInitializer.initContainer" . | nindent 8 }}
70 - name: {{ include "common.name" . }}-nginx
71 image: {{ include "repositoryGenerator.image.nginx" . }}
72 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.nginx.pullPolicy | quote }}
73 ports: {{- include "common.containerPorts" . | indent 12 -}}
74 {{- if .Values.nginx.livenessProbe }}
75 livenessProbe: {{- toYaml .Values.nginx.livenessProbe | nindent 12 }}
77 {{- if .Values.nginx.readinessProbe }}
78 readinessProbe: {{- toYaml .Values.nginx.readinessProbe | nindent 12 }}
80 {{- if .Values.nginx.resources }}
81 resources: {{- toYaml .Values.nginx.resources | nindent 12 }}
84 {{- if .Values.nginx.serverBlock }}
85 - name: nginx-server-block
86 mountPath: /opt/bitnami/nginx/conf/server_blocks
88 {{- include "common.certInitializer.volumeMount" . | nindent 10 }}
90 - name: {{ include "common.name" . }}-elasticsearch
91 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
92 {{- if .Values.securityContext.enabled }}
93 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
95 runAsUser: {{ .Values.securityContext.runAsUser }}
99 value: {{ ternary "true" "false" .Values.debug | quote }}
100 - name: ELASTICSEARCH_CLUSTER_NAME
101 value: {{ include "elasticsearch.clustername" .}}
102 - name: ELASTICSEARCH_CLUSTER_HOSTS
103 value: {{ include "common.name" . }}-discovery
104 {{- if .Values.plugins }}
105 - name: ELASTICSEARCH_PLUGINS
106 value: {{ .Values.plugins | quote }}
108 - name: ELASTICSEARCH_HEAP_SIZE
109 value: {{ .Values.heapSize | quote }}
110 - name: ELASTICSEARCH_IS_DEDICATED_NODE
112 - name: ELASTICSEARCH_NODE_TYPE
113 value: "coordinating"
114 - name: ELASTICSEARCH_PORT_NUMBER
116 - name: network.bind_host
118 - name: network.publish_host
121 fieldPath: status.podIP
122 {{/*ports: {{- include "common.containerPorts" . | indent 12 -}} */}}
123 {{- if .Values.livenessProbe.enabled }}
125 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
126 periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
127 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
128 successThreshold: {{ .Values.livenessProbe.successThreshold }}
129 failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
131 path: /_cluster/health?local=true
134 {{- if .Values.readinessProbe.enabled}}
136 initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
137 periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
138 timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
139 successThreshold: {{ .Values.readinessProbe.successThreshold }}
140 failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
142 path: /_cluster/health?local=true
145 {{- if .Values.resources }}
146 resources: {{- toYaml .Values.resources | nindent 12 }}
149 {{- if .Values.config }}
150 - mountPath: /opt/bitnami/elasticsearch/config/elasticsearch.yml
152 subPath: elasticsearch.yml
155 mountPath: "/bitnami/elasticsearch/data/"
156 {{- if .Values.extraVolumeMounts }}
157 {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
160 {{- if .Values.config }}
163 name: {{ include "common.fullname" . }}
167 {{- if .Values.extraVolumes }}
168 {{- toYaml .Values.extraVolumes | nindent 8 }}
170 {{- if .Values.nginx.serverBlock }}
171 - name: nginx-server-block
173 name: {{ include "common.fullname" . }}-nginx-server-block
175 {{ include "common.certInitializer.volumes" . | nindent 8 }}