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
69 - name: {{ include "common.name" . }}-nginx
70 image: {{ include "repositoryGenerator.image.nginx" . }}
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
88 - name: {{ include "common.name" . }}-elasticsearch
89 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
90 {{- if .Values.securityContext.enabled }}
91 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
93 runAsUser: {{ .Values.securityContext.runAsUser }}
97 value: {{ ternary "true" "false" .Values.debug | quote }}
98 - name: ELASTICSEARCH_CLUSTER_NAME
99 value: {{ include "elasticsearch.clustername" .}}
100 - name: ELASTICSEARCH_CLUSTER_HOSTS
101 value: {{ include "common.name" . }}-discovery
102 {{- if .Values.plugins }}
103 - name: ELASTICSEARCH_PLUGINS
104 value: {{ .Values.plugins | quote }}
106 - name: ELASTICSEARCH_HEAP_SIZE
107 value: {{ .Values.heapSize | quote }}
108 - name: ELASTICSEARCH_IS_DEDICATED_NODE
110 - name: ELASTICSEARCH_NODE_TYPE
111 value: "coordinating"
112 - name: ELASTICSEARCH_PORT_NUMBER
114 - name: network.bind_host
116 - name: network.publish_host
119 fieldPath: status.podIP
120 {{/*ports: {{- include "common.containerPorts" . | indent 12 -}} */}}
121 {{- if .Values.livenessProbe.enabled }}
123 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
124 periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
125 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
126 successThreshold: {{ .Values.livenessProbe.successThreshold }}
127 failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
129 path: /_cluster/health?local=true
132 {{- if .Values.readinessProbe.enabled}}
134 initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
135 periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
136 timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
137 successThreshold: {{ .Values.readinessProbe.successThreshold }}
138 failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
140 path: /_cluster/health?local=true
143 {{- if .Values.resources }}
144 resources: {{- toYaml .Values.resources | nindent 12 }}
147 {{- if .Values.config }}
148 - mountPath: /opt/bitnami/elasticsearch/config/elasticsearch.yml
150 subPath: elasticsearch.yml
153 mountPath: "/bitnami/elasticsearch/data/"
154 {{- if .Values.extraVolumeMounts }}
155 {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
158 {{- if .Values.config }}
161 name: {{ include "common.fullname" . }}
165 {{- if .Values.extraVolumes }}
166 {{- toYaml .Values.extraVolumes | nindent 8 }}
168 {{- if .Values.nginx.serverBlock }}
169 - name: nginx-server-block
171 name: {{ include "common.fullname" . }}-nginx-server-block