blob: 40c621068c18f4abc93ed9c4a1c99106e8db3ba0 [file] [log] [blame]
kj6a8ce802018-03-19 15:07:44 +02001apiVersion: extensions/v1beta1
2kind: Deployment
3metadata:
4 name: {{ include "common.fullname" . }}
5 namespace: {{ include "common.namespace" . }}
6 labels:
7 app: {{ include "common.name" . }}
8 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9 release: {{ .Release.Name }}
10 heritage: {{ .Release.Service }}
11spec:
12 replicas: {{ .Values.replicaCount }}
13 selector:
14 matchLabels:
15 app: {{ include "common.name" . }}
16 template:
17 metadata:
18 labels:
19 app: {{ include "common.name" . }}
Arul.Nambi1996ca02018-07-17 16:02:30 -040020 release: {{ .Release.Name }}
kj6a8ce802018-03-19 15:07:44 +020021 name: {{ include "common.name" . }}
22 spec:
23 initContainers:
24 - command:
25 - /bin/sh
26 - -c
27 - |
28 mkdir -p /logroot/elasticsearch/es-data
29 chmod -R 777 /logroot/elasticsearch/es-data
30 chown -R root:root /logroot
31 env:
32 - name: NAMESPACE
33 valueFrom:
34 fieldRef:
35 apiVersion: v1
36 fieldPath: metadata.namespace
37 securityContext:
38 privileged: true
39 image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
40 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41 name: init-sysctl
42 volumeMounts:
43 - name: elasticsearch-data
44 mountPath: /logroot/
45 hostname: {{ include "common.name" . }}
46 containers:
47 - name: {{ include "common.name" . }}
48 image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}
49 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50 ports:
51 - containerPort: {{ .Values.service.internalPort }}
52 # disable liveness probe when breakpoints set in debugger
53 # so K8s doesn't restart unresponsive container
54 {{- if eq .Values.liveness.enabled true }}
55 livenessProbe:
56 tcpSocket:
57 port: {{ .Values.service.internalPort }}
58 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
59 periodSeconds: {{ .Values.liveness.periodSeconds }}
60 {{ end -}}
61 readinessProbe:
62 tcpSocket:
63 port: {{ .Values.service.internalPort }}
64 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
65 periodSeconds: {{ .Values.readiness.periodSeconds }}
66 volumeMounts:
67 - name: localtime
68 mountPath: /etc/localtime
69 readOnly: true
70 - name: elasticsearch-config
71 subPath: elasticsearch.yml
72 mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
73 - name: elasticsearch-data
74 mountPath: /usr/share/elasticsearch/data
75 resources:
76{{ toYaml .Values.resources | indent 10 }}
77 {{- if .Values.nodeSelector }}
78 nodeSelector:
79{{ toYaml .Values.nodeSelector | indent 8 }}
80 {{- end -}}
81 {{- if .Values.affinity }}
82 affinity:
83{{ toYaml .Values.affinity | indent 8 }}
84 {{- end }}
85
86 volumes:
87 - name: localtime
88 hostPath:
89 path: /etc/localtime
90 - name: elasticsearch-config
91 configMap:
92 name: {{ include "common.fullname" . }}
93 - name: elasticsearch-data
94 hostPath:
BorislavGe6ed02a2018-05-03 14:29:51 +000095 path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
kj6a8ce802018-03-19 15:07:44 +020096 imagePullSecrets:
97 - name: "{{ include "common.namespace" . }}-docker-registry-key"