blob: 75df8a16e1bdcff68abc72cec18b18a0fc5f20f3 [file] [log] [blame]
Itay Hasside2da86d2017-08-24 12:54:42 +00001apiVersion: extensions/v1beta1
2kind: Deployment
3metadata:
4 labels:
5 app: elasticsearch
6 name: elasticsearch
7 namespace: {{ .Values.nsPrefix }}-log
8spec:
9 selector:
10 matchLabels:
11 app: elasticsearch
12 template:
13 metadata:
14 labels:
15 app: elasticsearch
16 name: elasticsearch
17 annotations:
18 pod.beta.kubernetes.io/init-containers: '[
19 {
20 "command": ["sysctl", "-w", "vm.max_map_count=262144"],
21 "env": [
22 {
23 "name": "NAMESPACE",
24 "valueFrom": {
25 "fieldRef": {
26 "apiVersion": "v1",
27 "fieldPath": "metadata.namespace"
28 }
29 }
30 }
31 ],
32 "securityContext": {
33 "privileged": true
34 },
35 "image": "{{ .Values.image.es_bb }}",
36 "imagePullPolicy": "{{ .Values.pullPolicy }}",
37 "name": "init-sysctl"
38 }
39 ]'
40 spec:
41 containers:
42 - name: elasticsearch
43 image: {{ .Values.image.elasticsearch}}
44 ports:
45 - containerPort: 9200
46 name: http
47 protocol: TCP
48 - containerPort: 9300
49 name: transport
50 protocol: TCP
51 readinessProbe:
52 tcpSocket:
53 port: 9200
54 volumeMounts:
55 - mountPath: /usr/share/elasticsearch/conf/
56 name: elasticsearch-conf
57 - mountPath: /usr/share/elasticsearch/data/
58 name: elasticsearch-data
59 - mountPath: /usr/share/elasticsearch/logs/
60 name: elasticsearch-logs
61 volumes:
62 - name: elasticsearch-data
63 persistentVolumeClaim:
64 claimName: elasticsearch-db
65 - name: elasticsearch-logs
66 hostPath:
67 path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/elasticsearch/logs
68 - name: elasticsearch-conf
69 configMap:
70 name: elasticsearch-configmap
71 items:
72 - key: elasticsearch.yml
73 path: elasticsearch.yml
74---
75apiVersion: v1
76kind: ConfigMap
77metadata:
78 name: elasticsearch-configmap
79 namespace: {{ .Values.nsPrefix }}-log
80data:
81{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }}