blob: cbc19a859163360bfc330ba09d6ad0e349636a0b [file] [log] [blame]
yurynfcef9942017-10-26 17:10:50 +03001#{{ if not .Values.disableLogElasticsearch }}
Itay Hasside2da86d2017-08-24 12:54:42 +00002apiVersion: extensions/v1beta1
3kind: Deployment
4metadata:
5 labels:
6 app: elasticsearch
BorislavG8bfc6cf2018-02-27 15:04:26 +00007 name: log-elasticsearch
8 namespace: {{ .Values.nsPrefix }}
Itay Hasside2da86d2017-08-24 12:54:42 +00009spec:
vaibhav_16decb7d08b22018-02-16 06:33:55 +000010 replicas: {{ .Values.elasticsearchReplicas }}
Itay Hasside2da86d2017-08-24 12:54:42 +000011 selector:
12 matchLabels:
13 app: elasticsearch
14 template:
15 metadata:
16 labels:
17 app: elasticsearch
BorislavG8bfc6cf2018-02-27 15:04:26 +000018 name: log-elasticsearch
Itay Hasside2da86d2017-08-24 12:54:42 +000019 spec:
kiranya7a318212017-11-22 13:40:04 +000020 initContainers:
21 - command:
mayankg2703d21b8b62018-01-18 16:58:09 +000022 - /bin/sh
23 - -c
24 - |
25 sysctl -w vm.max_map_count=262144
26 mkdir -p /logroot/elasticsearch/logs
27 mkdir -p /logroot/elasticsearch/data
28 chmod -R 777 /logroot/elasticsearch
29 chown -R root:root /logroot
kiranya7a318212017-11-22 13:40:04 +000030 env:
31 - name: NAMESPACE
32 valueFrom:
33 fieldRef:
34 apiVersion: v1
35 fieldPath: metadata.namespace
36 securityContext:
37 privileged: true
38 image: {{ .Values.image.es_bb }}
39 imagePullPolicy: {{ .Values.pullPolicy }}
40 name: init-sysctl
mayankg2703d21b8b62018-01-18 16:58:09 +000041 volumeMounts:
42 - name: elasticsearch-logs
43 mountPath: /logroot/
Itay Hasside2da86d2017-08-24 12:54:42 +000044 containers:
45 - name: elasticsearch
46 image: {{ .Values.image.elasticsearch}}
47 ports:
48 - containerPort: 9200
49 name: http
50 protocol: TCP
51 - containerPort: 9300
52 name: transport
53 protocol: TCP
54 readinessProbe:
55 tcpSocket:
BorislavG2631be82017-11-01 12:48:42 +020056 port: 9300
Itay Hasside2da86d2017-08-24 12:54:42 +000057 volumeMounts:
BorislavG2631be82017-11-01 12:48:42 +020058 - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
Itay Hasside2da86d2017-08-24 12:54:42 +000059 name: elasticsearch-conf
BorislavG2631be82017-11-01 12:48:42 +020060 subPath: elasticsearch.yml
Itay Hasside2da86d2017-08-24 12:54:42 +000061 - mountPath: /usr/share/elasticsearch/data/
62 name: elasticsearch-data
63 - mountPath: /usr/share/elasticsearch/logs/
64 name: elasticsearch-logs
65 volumes:
66 - name: elasticsearch-data
67 persistentVolumeClaim:
68 claimName: elasticsearch-db
69 - name: elasticsearch-logs
70 hostPath:
kerenj81c063d2018-02-25 09:10:45 +000071 path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/
Itay Hasside2da86d2017-08-24 12:54:42 +000072 - name: elasticsearch-conf
73 configMap:
BorislavG8bfc6cf2018-02-27 15:04:26 +000074 name: log-elasticsearch-configmap
Itay Hasside2da86d2017-08-24 12:54:42 +000075 items:
76 - key: elasticsearch.yml
77 path: elasticsearch.yml
78---
79apiVersion: v1
80kind: ConfigMap
81metadata:
BorislavG8bfc6cf2018-02-27 15:04:26 +000082 name: log-elasticsearch-configmap
83 namespace: {{ .Values.nsPrefix }}
Itay Hasside2da86d2017-08-24 12:54:42 +000084data:
yurynfcef9942017-10-26 17:10:50 +030085{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }}
BorislavG2631be82017-11-01 12:48:42 +020086#{{ end }}
87