blob: f0db31a28990c6f059e8391d5ea2770a46e20188 [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:
54 port: 9200
55 volumeMounts:
56 - mountPath: /usr/share/elasticsearch/conf/
57 name: elasticsearch-conf
58 - mountPath: /usr/share/elasticsearch/data/
59 name: elasticsearch-data
60 - mountPath: /usr/share/elasticsearch/logs/
61 name: elasticsearch-logs
62 volumes:
63 - name: elasticsearch-data
64 persistentVolumeClaim:
65 claimName: elasticsearch-db
66 - name: elasticsearch-logs
67 hostPath:
68 path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/elasticsearch/logs
69 - name: elasticsearch-conf
70 configMap:
71 name: elasticsearch-configmap
72 items:
73 - key: elasticsearch.yml
74 path: elasticsearch.yml
75---
76apiVersion: v1
77kind: ConfigMap
78metadata:
79 name: elasticsearch-configmap
80 namespace: {{ .Values.nsPrefix }}-log
81data:
yurynfcef9942017-10-26 17:10:50 +030082{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }}
83#{{ end }}