blob: 05a9b18ac9391913086140420368d2234377879c [file] [log] [blame]
Jakub Latusekc586acb2020-10-21 13:36:29 +02001{{/*
BorislavG5f3b6192018-03-25 18:12:38 +03002# Copyright © 2017 Amdocs, Bell Canada
Mukul7de56c82018-09-04 08:03:27 +00003# Modifications Copyright © 2018 AT&T
BorislavG5f3b6192018-03-25 18:12:38 +03004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latusekc586acb2020-10-21 13:36:29 +020016*/}}
BorislavG5f3b6192018-03-25 18:12:38 +030017
18apiVersion: extensions/v1beta1
19kind: Deployment
20metadata:
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
BorislavG5f3b6192018-03-25 18:12:38 +030027 heritage: {{ .Release.Service }}
28spec:
29 replicas: {{ .Values.replicaCount }}
30 template:
31 metadata:
32 labels:
33 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010034 release: {{ include "common.release" . }}
BorislavG5f3b6192018-03-25 18:12:38 +030035 spec:
36 initContainers:
37 - command:
38 - /bin/sh
39 - -c
40 - |
41 sysctl -w vm.max_map_count=262144
42 mkdir -p /logroot/elasticsearch/logs
43 mkdir -p /logroot/elasticsearch/data
44 chmod -R 777 /logroot/elasticsearch
45 chown -R root:root /logroot
46 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
52 securityContext:
53 privileged: true
54 image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }}
55 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 name: init-sysctl
57 volumeMounts:
58 - name: {{ include "common.fullname" . }}-logs
59 mountPath: /logroot/
60 containers:
61 - name: {{ include "common.name" . }}
62 image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}"
63 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
vaibhavjayas659fbae2018-09-19 08:58:10 +000064 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000065{{ include "common.resources" . | indent 12 }}
BorislavG5f3b6192018-03-25 18:12:38 +030066 ports:
67 - containerPort: {{ .Values.service.internalPort }}
68 name: {{ .Values.service.name }}
BorislavG2cf26842018-04-08 17:50:07 +030069 - containerPort: {{ .Values.service.internalPort2 }}
70 name: {{ .Values.service.name2 }}
BorislavG5f3b6192018-03-25 18:12:38 +030071# disable liveness probe when breakpoints set in debugger
72 # so K8s doesn't restart unresponsive container
73 {{- if eq .Values.liveness.enabled true }}
74 livenessProbe:
75 tcpSocket:
76 port: {{ .Values.service.internalPort }}
77 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
78 periodSeconds: {{ .Values.liveness.periodSeconds }}
79 {{ end -}}
80 readinessProbe:
81 tcpSocket:
BorislavG2cf26842018-04-08 17:50:07 +030082 port: {{ .Values.service.internalPort2 }}
BorislavG5f3b6192018-03-25 18:12:38 +030083 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
84 periodSeconds: {{ .Values.readiness.periodSeconds }}
85 env:
86 volumeMounts:
87 - mountPath: /etc/localtime
88 name: localtime
89 readOnly: true
90 - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
91 name: {{ include "common.fullname" . }}-config
92 subPath: elasticsearch.yml
93 - mountPath: /usr/share/elasticsearch/data/
94 name: {{ include "common.fullname" . }}-data
BorislavG5f3b6192018-03-25 18:12:38 +030095 volumes:
96 - name: localtime
97 hostPath:
98 path: /etc/localtime
99 - name: {{ include "common.fullname" . }}-config
100 configMap:
101 name: {{ include "common.fullname" . }}-configmap
102 items:
103 - key: elasticsearch.yml
104 path: elasticsearch.yml
105 - name: {{ include "common.fullname" . }}-data
106 persistentVolumeClaim:
107 claimName: {{ include "common.fullname" . }}
108 - name: {{ include "common.fullname" . }}-logs
109 hostPath:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100110 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPathLogs }}
BorislavG5f3b6192018-03-25 18:12:38 +0300111 imagePullSecrets:
112 - name: "{{ include "common.namespace" . }}-docker-registry-key"