blob: 58ff1075689c88b42117efc6f39743d384e4c6c8 [file] [log] [blame]
ac25508ac97172018-04-18 14:23:17 +02001# Copyright © 2017 Amdocs, Bell Canada
Mukul379e2522018-09-05 12:26:02 +00002# Modifications Copyright © 2018 AT&T
ac25508ac97172018-04-18 14:23:17 +02003#
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
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
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.
ac25508ac97172018-04-18 14:23:17 +020015
16apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
ac25508ac97172018-04-18 14:23:17 +020025 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
ac25508ac97172018-04-18 14:23:17 +020033 spec:
34 initContainers:
35 - command:
36 - /bin/sh
37 - -c
38 - |
39 sysctl -w vm.max_map_count=262144
40 mkdir -p /usr/share/elasticsearch/logs
41 mkdir -p /usr/share/elasticsearch/data
42 chmod -R 777 /usr/share/elasticsearch
43 env:
44 - name: NAMESPACE
45 valueFrom:
46 fieldRef:
47 apiVersion: v1
48 fieldPath: metadata.namespace
49 securityContext:
50 privileged: true
51 image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }}
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 name: init-sysctl
54 volumeMounts:
55 - name: {{ include "common.fullname" . }}-logs
56 mountPath: /usr/share/elasticsearch/logs/
57 - name: {{ include "common.fullname" . }}-data
58 mountPath: /usr/share/elasticsearch/data/
59 containers:
60 - name: {{ include "common.name" . }}
sebdet6336f332019-08-26 07:51:23 -070061 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
ac25508ac97172018-04-18 14:23:17 +020062 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63 ports:
64 - containerPort: {{ .Values.service.internalPort }}
65 name: {{ include "common.servicename" . }}
66 - containerPort: {{ .Values.service.internalPort2 }}
67 name: {{ include "common.servicename" . }}2
68# disable liveness probe when breakpoints set in debugger
69 # so K8s doesn't restart unresponsive container
70 {{- if eq .Values.liveness.enabled true }}
71 livenessProbe:
72 tcpSocket:
73 port: {{ .Values.service.internalPort }}
74 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.liveness.periodSeconds }}
osgn422wb561a592020-02-11 15:50:21 +010076 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
ac25508ac97172018-04-18 14:23:17 +020077 {{ end -}}
78 readinessProbe:
79 tcpSocket:
80 port: {{ .Values.service.internalPort2 }}
81 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
82 periodSeconds: {{ .Values.readiness.periodSeconds }}
osgn422wb561a592020-02-11 15:50:21 +010083 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
ac25508ac97172018-04-18 14:23:17 +020084 env:
85 volumeMounts:
86 - mountPath: /etc/localtime
87 name: localtime
88 readOnly: true
89 - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
90 name: {{ include "common.fullname" . }}-config
91 subPath: elasticsearch.yml
92 - mountPath: /usr/share/elasticsearch/data/
93 name: {{ include "common.fullname" . }}-data
94 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000095{{ include "common.resources" . | indent 12 }}
ac25508ac97172018-04-18 14:23:17 +020096 {{- if .Values.nodeSelector }}
97 nodeSelector:
98{{ toYaml .Values.nodeSelector | indent 10 }}
99 {{- end -}}
100 {{- if .Values.affinity }}
101 affinity:
102{{ toYaml .Values.affinity | indent 10 }}
103 {{- end }}
104 volumes:
105 - name: localtime
106 hostPath:
107 path: /etc/localtime
108 - name: {{ include "common.fullname" . }}-config
109 configMap:
110 name: {{ include "common.fullname" . }}-configmap
111 items:
112 - key: elasticsearch.yml
113 path: elasticsearch.yml
114 - name: {{ include "common.fullname" . }}-data
115 persistentVolumeClaim:
116 claimName: {{ include "common.fullname" . }}
117 - name: {{ include "common.fullname" . }}-logs
118 hostPath:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100119 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPathLogs }}
ac25508ac97172018-04-18 14:23:17 +0200120 imagePullSecrets:
121 - name: "{{ include "common.namespace" . }}-docker-registry-key"