blob: c123df1daaff95d15bb689c4adbcc9c6a0067b3b [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
18 annotations:
19 pod.beta.kubernetes.io/init-containers: '[
20 {
21 "command": ["sysctl", "-w", "vm.max_map_count=262144"],
22 "env": [
23 {
24 "name": "NAMESPACE",
25 "valueFrom": {
26 "fieldRef": {
27 "apiVersion": "v1",
28 "fieldPath": "metadata.namespace"
29 }
30 }
31 }
32 ],
33 "securityContext": {
34 "privileged": true
35 },
36 "image": "{{ .Values.image.es_bb }}",
37 "imagePullPolicy": "{{ .Values.pullPolicy }}",
38 "name": "init-sysctl"
39 }
40 ]'
41 spec:
42 containers:
43 - name: elasticsearch
44 image: {{ .Values.image.elasticsearch}}
45 ports:
46 - containerPort: 9200
47 name: http
48 protocol: TCP
49 - containerPort: 9300
50 name: transport
51 protocol: TCP
52 readinessProbe:
53 tcpSocket:
BorislavG2631be82017-11-01 12:48:42 +020054 port: 9300
Itay Hasside2da86d2017-08-24 12:54:42 +000055 volumeMounts:
BorislavG2631be82017-11-01 12:48:42 +020056 - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
Itay Hasside2da86d2017-08-24 12:54:42 +000057 name: elasticsearch-conf
BorislavG2631be82017-11-01 12:48:42 +020058 subPath: elasticsearch.yml
Itay Hasside2da86d2017-08-24 12:54:42 +000059 - mountPath: /usr/share/elasticsearch/data/
60 name: elasticsearch-data
61 - mountPath: /usr/share/elasticsearch/logs/
62 name: elasticsearch-logs
63 volumes:
64 - name: elasticsearch-data
65 persistentVolumeClaim:
66 claimName: elasticsearch-db
67 - name: elasticsearch-logs
68 hostPath:
69 path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/elasticsearch/logs
70 - name: elasticsearch-conf
71 configMap:
72 name: elasticsearch-configmap
73 items:
74 - key: elasticsearch.yml
75 path: elasticsearch.yml
76---
77apiVersion: v1
78kind: ConfigMap
79metadata:
80 name: elasticsearch-configmap
81 namespace: {{ .Values.nsPrefix }}-log
82data:
yurynfcef9942017-10-26 17:10:50 +030083{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }}
BorislavG2631be82017-11-01 12:48:42 +020084#{{ end }}
85