blob: bbf7260faa999cd9daabff19d62e2e4b60143213 [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
7 name: elasticsearch
8 namespace: {{ .Values.nsPrefix }}-log
9spec:
10 selector:
11 matchLabels:
12 app: elasticsearch
13 template:
14 metadata:
15 labels:
16 app: elasticsearch
17 name: elasticsearch
Itay Hasside2da86d2017-08-24 12:54:42 +000018 spec:
kiranya7a318212017-11-22 13:40:04 +000019 initContainers:
20 - command:
mayankg2703d21b8b62018-01-18 16:58:09 +000021 - /bin/sh
22 - -c
23 - |
24 sysctl -w vm.max_map_count=262144
25 mkdir -p /logroot/elasticsearch/logs
26 mkdir -p /logroot/elasticsearch/data
27 chmod -R 777 /logroot/elasticsearch
28 chown -R root:root /logroot
kiranya7a318212017-11-22 13:40:04 +000029 env:
30 - name: NAMESPACE
31 valueFrom:
32 fieldRef:
33 apiVersion: v1
34 fieldPath: metadata.namespace
35 securityContext:
36 privileged: true
37 image: {{ .Values.image.es_bb }}
38 imagePullPolicy: {{ .Values.pullPolicy }}
39 name: init-sysctl
mayankg2703d21b8b62018-01-18 16:58:09 +000040 volumeMounts:
41 - name: elasticsearch-logs
42 mountPath: /logroot/
Itay Hasside2da86d2017-08-24 12:54:42 +000043 containers:
44 - name: elasticsearch
45 image: {{ .Values.image.elasticsearch}}
46 ports:
47 - containerPort: 9200
48 name: http
49 protocol: TCP
50 - containerPort: 9300
51 name: transport
52 protocol: TCP
53 readinessProbe:
54 tcpSocket:
BorislavG2631be82017-11-01 12:48:42 +020055 port: 9300
Itay Hasside2da86d2017-08-24 12:54:42 +000056 volumeMounts:
BorislavG2631be82017-11-01 12:48:42 +020057 - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
Itay Hasside2da86d2017-08-24 12:54:42 +000058 name: elasticsearch-conf
BorislavG2631be82017-11-01 12:48:42 +020059 subPath: elasticsearch.yml
Itay Hasside2da86d2017-08-24 12:54:42 +000060 - mountPath: /usr/share/elasticsearch/data/
61 name: elasticsearch-data
62 - mountPath: /usr/share/elasticsearch/logs/
63 name: elasticsearch-logs
64 volumes:
65 - name: elasticsearch-data
66 persistentVolumeClaim:
67 claimName: elasticsearch-db
68 - name: elasticsearch-logs
69 hostPath:
mayankg2703d21b8b62018-01-18 16:58:09 +000070 path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/
Itay Hasside2da86d2017-08-24 12:54:42 +000071 - name: elasticsearch-conf
72 configMap:
73 name: elasticsearch-configmap
74 items:
75 - key: elasticsearch.yml
76 path: elasticsearch.yml
77---
78apiVersion: v1
79kind: ConfigMap
80metadata:
81 name: elasticsearch-configmap
82 namespace: {{ .Values.nsPrefix }}-log
83data:
yurynfcef9942017-10-26 17:10:50 +030084{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }}
BorislavG2631be82017-11-01 12:48:42 +020085#{{ end }}
86