7eae172c3bbc6f1af2e1cc97a1ffbc41a6819c89
[oom.git] / kubernetes / aai / templates / elasticsearch-deployment.yaml
1 #{{ if not .Values.disableAaiElasticsearch }}
2 apiVersion: extensions/v1beta1
3 kind: Deployment
4 metadata:
5   name: elasticsearch
6   namespace: "{{ .Values.nsPrefix }}-aai"
7 spec:
8   replicas: {{ .Values.elasticsearchReplicas }}
9   selector:
10     matchLabels:
11       app: elasticsearch
12   template:
13     metadata:
14       labels:
15         app: elasticsearch
16       name: elasticsearch
17     spec:
18       initContainers:
19       - command:
20         - /bin/sh
21         - -c
22         - |
23           mkdir -p /logroot/elasticsearch/es-data
24           chmod -R 777 /logroot/elasticsearch/es-data
25           chown -R root:root /logroot
26         env:
27         - name: NAMESPACE
28           valueFrom:
29             fieldRef:
30               apiVersion: v1
31               fieldPath: metadata.namespace
32         securityContext:
33           privileged: true
34         image: {{ .Values.image.es_bb }}
35         imagePullPolicy: {{ .Values.pullPolicy }}
36         name: init-sysctl
37         volumeMounts:
38         - name: elasticsearch-data
39           mountPath: /logroot/
40       hostname: elasticsearch
41       containers:
42       - name: elasticsearch
43         image: "{{ .Values.image.elasticsearchImage }}:{{ .Values.image.elasticsearchVersion }}"
44         imagePullPolicy: {{ .Values.pullPolicy }}
45         ports:
46         - containerPort: 9200
47         readinessProbe:
48           tcpSocket:
49             port: 9200
50           initialDelaySeconds: 5
51           periodSeconds: 10
52         volumeMounts:
53         - name: localtime
54           mountPath: /etc/localtime
55           readOnly: true
56         - name: elasticsearch-config
57           subPath: elasticsearch.yml
58           mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
59         - name: elasticsearch-data
60           mountPath: /usr/share/elasticsearch/data
61       volumes:
62       - name: localtime
63         hostPath:
64           path: /etc/localtime
65       - name: elasticsearch-config
66         configMap:
67           name: aai-elasticsearch-configmap
68       - name: elasticsearch-data
69         hostPath:
70           path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/elasticsearch/data"
71       imagePullSecrets:
72       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
73 #{{ end }}