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