blob: 24cdb921b23208114ceed4db1f6707313edea383 [file] [log] [blame]
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00001# Copyright © 2018 Amdocs, Bell Canada, AT&T
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
kj9bf27312018-03-19 15:07:44 +020015apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 selector:
28 matchLabels:
29 app: {{ include "common.name" . }}
30 template:
31 metadata:
32 labels:
33 app: {{ include "common.name" . }}
Arul.Nambib8c668f2018-07-17 16:02:30 -040034 release: {{ .Release.Name }}
kj9bf27312018-03-19 15:07:44 +020035 name: {{ include "common.name" . }}
36 spec:
37 initContainers:
38 - command:
39 - /bin/sh
40 - -c
41 - |
Edwin Lawrance0d4b4b52018-08-02 15:57:13 +010042 mkdir -p /logroot/elasticsearch/logs
43 mkdir -p /logroot/elasticsearch/data
44 chmod -R 777 /logroot/elasticsearch
45 chown -R 1000:1000 /logroot
kj9bf27312018-03-19 15:07:44 +020046 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
52 securityContext:
53 privileged: true
54 image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
55 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 name: init-sysctl
57 volumeMounts:
58 - name: elasticsearch-data
59 mountPath: /logroot/
60 hostname: {{ include "common.name" . }}
61 containers:
62 - name: {{ include "common.name" . }}
Edwin Lawrance0d4b4b52018-08-02 15:57:13 +010063 image: {{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}
kj9bf27312018-03-19 15:07:44 +020064 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
65 ports:
66 - containerPort: {{ .Values.service.internalPort }}
67 # disable liveness probe when breakpoints set in debugger
68 # so K8s doesn't restart unresponsive container
69 {{- if eq .Values.liveness.enabled true }}
70 livenessProbe:
71 tcpSocket:
72 port: {{ .Values.service.internalPort }}
73 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
74 periodSeconds: {{ .Values.liveness.periodSeconds }}
75 {{ end -}}
76 readinessProbe:
77 tcpSocket:
78 port: {{ .Values.service.internalPort }}
79 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
80 periodSeconds: {{ .Values.readiness.periodSeconds }}
81 volumeMounts:
82 - name: localtime
83 mountPath: /etc/localtime
84 readOnly: true
85 - name: elasticsearch-config
86 subPath: elasticsearch.yml
87 mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
Edwin Lawrance0d4b4b52018-08-02 15:57:13 +010088 - name: elasticsearch-config
89 subPath: jvm.options
90 mountPath: /usr/share/elasticsearch/config/jvm.options
91 - name: elasticsearch-config
92 subPath: log4j2.properties
93 mountPath: /usr/share/elasticsearch/config/log4j2.properties
kj9bf27312018-03-19 15:07:44 +020094 - name: elasticsearch-data
95 mountPath: /usr/share/elasticsearch/data
96 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000097{{ include "common.resources" . | indent 12 }}
kj9bf27312018-03-19 15:07:44 +020098 {{- if .Values.nodeSelector }}
99 nodeSelector:
100{{ toYaml .Values.nodeSelector | indent 8 }}
101 {{- end -}}
102 {{- if .Values.affinity }}
103 affinity:
104{{ toYaml .Values.affinity | indent 8 }}
105 {{- end }}
106
107 volumes:
108 - name: localtime
109 hostPath:
110 path: /etc/localtime
111 - name: elasticsearch-config
112 configMap:
113 name: {{ include "common.fullname" . }}
114 - name: elasticsearch-data
115 hostPath:
BorislavG56857c42018-05-03 14:29:51 +0000116 path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
kj9bf27312018-03-19 15:07:44 +0200117 imagePullSecrets:
118 - name: "{{ include "common.namespace" . }}-docker-registry-key"