AAI-UI es index are not getting populated
[oom.git] / kubernetes / aai / charts / aai-elasticsearch / templates / deployment.yaml
1 apiVersion: extensions/v1beta1
2 kind: Deployment
3 metadata:
4   name: {{ include "common.fullname" . }}
5   namespace: {{ include "common.namespace" . }}
6   labels:
7     app: {{ include "common.name" . }}
8     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9     release: {{ .Release.Name }}
10     heritage: {{ .Release.Service }}
11 spec:
12   replicas: {{ .Values.replicaCount }}
13   selector:
14     matchLabels:
15       app: {{ include "common.name" . }}
16   template:
17     metadata:
18       labels:
19         app: {{ include "common.name" . }}
20         release: {{ .Release.Name }}
21       name: {{ include "common.name" . }}
22     spec:
23       initContainers:
24       - command:
25         - /bin/sh
26         - -c
27         - |
28           mkdir -p /logroot/elasticsearch/es-data
29           chmod -R 777 /logroot/elasticsearch/es-data
30           chown -R root:root /logroot
31         env:
32         - name: NAMESPACE
33           valueFrom:
34             fieldRef:
35               apiVersion: v1
36               fieldPath: metadata.namespace
37         securityContext:
38           privileged: true
39         image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
40         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41         name: init-sysctl
42         volumeMounts:
43         - name: elasticsearch-data
44           mountPath: /logroot/
45       hostname: {{ include "common.name" . }}
46       containers:
47       - name: {{ include "common.name" . }}
48         image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}
49         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50         ports:
51         - containerPort: {{ .Values.service.internalPort }}
52         # disable liveness probe when breakpoints set in debugger
53         # so K8s doesn't restart unresponsive container
54         {{- if eq .Values.liveness.enabled true }}
55         livenessProbe:
56           tcpSocket:
57             port: {{ .Values.service.internalPort }}
58           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
59           periodSeconds: {{ .Values.liveness.periodSeconds }}
60         {{ end -}}
61         readinessProbe:
62           tcpSocket:
63             port: {{ .Values.service.internalPort }}
64           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
65           periodSeconds: {{ .Values.readiness.periodSeconds }}
66         volumeMounts:
67           - name: localtime
68             mountPath: /etc/localtime
69             readOnly: true
70           - name: elasticsearch-config
71             subPath: elasticsearch.yml
72             mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
73           - name: elasticsearch-data
74             mountPath: /usr/share/elasticsearch/data
75         resources:
76 {{ toYaml .Values.resources | indent 10 }}
77       {{- if .Values.nodeSelector }}
78       nodeSelector:
79 {{ toYaml .Values.nodeSelector | indent 8 }}
80       {{- end -}}
81       {{- if .Values.affinity }}
82       affinity:
83 {{ toYaml .Values.affinity | indent 8 }}
84       {{- end }}
85
86       volumes:
87       - name: localtime
88         hostPath:
89           path: /etc/localtime
90       - name: elasticsearch-config
91         configMap:
92           name: {{ include "common.fullname" . }}
93       - name: elasticsearch-data
94         hostPath:
95           path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
96       imagePullSecrets:
97       - name: "{{ include "common.namespace" . }}-docker-registry-key"