blob: a6c93b8ea0233bb6694f24b76eb25eacb56ebad7 [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 - |
42 mkdir -p /logroot/elasticsearch/es-data
43 chmod -R 777 /logroot/elasticsearch/es-data
44 chown -R root:root /logroot
45 env:
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
51 securityContext:
52 privileged: true
53 image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 name: init-sysctl
56 volumeMounts:
57 - name: elasticsearch-data
58 mountPath: /logroot/
59 hostname: {{ include "common.name" . }}
60 containers:
61 - name: {{ include "common.name" . }}
62 image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}
63 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64 ports:
65 - containerPort: {{ .Values.service.internalPort }}
66 # disable liveness probe when breakpoints set in debugger
67 # so K8s doesn't restart unresponsive container
68 {{- if eq .Values.liveness.enabled true }}
69 livenessProbe:
70 tcpSocket:
71 port: {{ .Values.service.internalPort }}
72 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
73 periodSeconds: {{ .Values.liveness.periodSeconds }}
74 {{ end -}}
75 readinessProbe:
76 tcpSocket:
77 port: {{ .Values.service.internalPort }}
78 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.readiness.periodSeconds }}
80 volumeMounts:
81 - name: localtime
82 mountPath: /etc/localtime
83 readOnly: true
84 - name: elasticsearch-config
85 subPath: elasticsearch.yml
86 mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
87 - name: elasticsearch-data
88 mountPath: /usr/share/elasticsearch/data
89 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000090{{ include "common.resources" . | indent 12 }}
kj9bf27312018-03-19 15:07:44 +020091 {{- if .Values.nodeSelector }}
92 nodeSelector:
93{{ toYaml .Values.nodeSelector | indent 8 }}
94 {{- end -}}
95 {{- if .Values.affinity }}
96 affinity:
97{{ toYaml .Values.affinity | indent 8 }}
98 {{- end }}
99
100 volumes:
101 - name: localtime
102 hostPath:
103 path: /etc/localtime
104 - name: elasticsearch-config
105 configMap:
106 name: {{ include "common.fullname" . }}
107 - name: elasticsearch-data
108 hostPath:
BorislavG56857c42018-05-03 14:29:51 +0000109 path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
kj9bf27312018-03-19 15:07:44 +0200110 imagePullSecrets:
111 - name: "{{ include "common.namespace" . }}-docker-registry-key"