blob: 8c09479b43f8878643e0723fda345cad9b5b403c [file] [log] [blame]
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00001# Copyright © 2017 Amdocs, Bell Canada
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
yurynfcef9942017-10-26 17:10:50 +030015#{{ if not .Values.disableLogElasticsearch }}
Itay Hasside2da86d2017-08-24 12:54:42 +000016apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
19 labels:
20 app: elasticsearch
BorislavG8bfc6cf2018-02-27 15:04:26 +000021 name: log-elasticsearch
22 namespace: {{ .Values.nsPrefix }}
Itay Hasside2da86d2017-08-24 12:54:42 +000023spec:
vaibhav_16decb7d08b22018-02-16 06:33:55 +000024 replicas: {{ .Values.elasticsearchReplicas }}
Itay Hasside2da86d2017-08-24 12:54:42 +000025 selector:
26 matchLabels:
27 app: elasticsearch
28 template:
29 metadata:
30 labels:
31 app: elasticsearch
BorislavG8bfc6cf2018-02-27 15:04:26 +000032 name: log-elasticsearch
Itay Hasside2da86d2017-08-24 12:54:42 +000033 spec:
kiranya7a318212017-11-22 13:40:04 +000034 initContainers:
35 - command:
mayankg2703d21b8b62018-01-18 16:58:09 +000036 - /bin/sh
37 - -c
38 - |
39 sysctl -w vm.max_map_count=262144
40 mkdir -p /logroot/elasticsearch/logs
41 mkdir -p /logroot/elasticsearch/data
42 chmod -R 777 /logroot/elasticsearch
43 chown -R root:root /logroot
kiranya7a318212017-11-22 13:40:04 +000044 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
50 securityContext:
51 privileged: true
52 image: {{ .Values.image.es_bb }}
53 imagePullPolicy: {{ .Values.pullPolicy }}
54 name: init-sysctl
mayankg2703d21b8b62018-01-18 16:58:09 +000055 volumeMounts:
56 - name: elasticsearch-logs
57 mountPath: /logroot/
Itay Hasside2da86d2017-08-24 12:54:42 +000058 containers:
59 - name: elasticsearch
60 image: {{ .Values.image.elasticsearch}}
61 ports:
62 - containerPort: 9200
63 name: http
64 protocol: TCP
65 - containerPort: 9300
66 name: transport
67 protocol: TCP
68 readinessProbe:
69 tcpSocket:
BorislavG2631be82017-11-01 12:48:42 +020070 port: 9300
Itay Hasside2da86d2017-08-24 12:54:42 +000071 volumeMounts:
BorislavG2631be82017-11-01 12:48:42 +020072 - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
Itay Hasside2da86d2017-08-24 12:54:42 +000073 name: elasticsearch-conf
BorislavG2631be82017-11-01 12:48:42 +020074 subPath: elasticsearch.yml
Itay Hasside2da86d2017-08-24 12:54:42 +000075 - mountPath: /usr/share/elasticsearch/data/
76 name: elasticsearch-data
77 - mountPath: /usr/share/elasticsearch/logs/
78 name: elasticsearch-logs
79 volumes:
80 - name: elasticsearch-data
81 persistentVolumeClaim:
82 claimName: elasticsearch-db
83 - name: elasticsearch-logs
84 hostPath:
kerenj81c063d2018-02-25 09:10:45 +000085 path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/
Itay Hasside2da86d2017-08-24 12:54:42 +000086 - name: elasticsearch-conf
87 configMap:
BorislavG8bfc6cf2018-02-27 15:04:26 +000088 name: log-elasticsearch-configmap
Itay Hasside2da86d2017-08-24 12:54:42 +000089 items:
90 - key: elasticsearch.yml
91 path: elasticsearch.yml
92---
93apiVersion: v1
94kind: ConfigMap
95metadata:
BorislavG8bfc6cf2018-02-27 15:04:26 +000096 name: log-elasticsearch-configmap
97 namespace: {{ .Values.nsPrefix }}
Itay Hasside2da86d2017-08-24 12:54:42 +000098data:
yurynfcef9942017-10-26 17:10:50 +030099{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }}
BorislavG2631be82017-11-01 12:48:42 +0200100#{{ end }}
101