vaibhav_16dec | e04b2fe | 2018-03-22 09:07:12 +0000 | [diff] [blame^] | 1 | # 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 | |
yuryn | fcef994 | 2017-10-26 17:10:50 +0300 | [diff] [blame] | 15 | #{{ if not .Values.disableLogElasticsearch }} |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 16 | apiVersion: extensions/v1beta1 |
| 17 | kind: Deployment |
| 18 | metadata: |
| 19 | labels: |
| 20 | app: elasticsearch |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 21 | name: log-elasticsearch |
| 22 | namespace: {{ .Values.nsPrefix }} |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 23 | spec: |
vaibhav_16dec | b7d08b2 | 2018-02-16 06:33:55 +0000 | [diff] [blame] | 24 | replicas: {{ .Values.elasticsearchReplicas }} |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 25 | selector: |
| 26 | matchLabels: |
| 27 | app: elasticsearch |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: elasticsearch |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 32 | name: log-elasticsearch |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 33 | spec: |
kiranya | 7a31821 | 2017-11-22 13:40:04 +0000 | [diff] [blame] | 34 | initContainers: |
| 35 | - command: |
mayankg2703 | d21b8b6 | 2018-01-18 16:58:09 +0000 | [diff] [blame] | 36 | - /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 |
kiranya | 7a31821 | 2017-11-22 13:40:04 +0000 | [diff] [blame] | 44 | 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 |
mayankg2703 | d21b8b6 | 2018-01-18 16:58:09 +0000 | [diff] [blame] | 55 | volumeMounts: |
| 56 | - name: elasticsearch-logs |
| 57 | mountPath: /logroot/ |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 58 | 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: |
BorislavG | 2631be8 | 2017-11-01 12:48:42 +0200 | [diff] [blame] | 70 | port: 9300 |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 71 | volumeMounts: |
BorislavG | 2631be8 | 2017-11-01 12:48:42 +0200 | [diff] [blame] | 72 | - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 73 | name: elasticsearch-conf |
BorislavG | 2631be8 | 2017-11-01 12:48:42 +0200 | [diff] [blame] | 74 | subPath: elasticsearch.yml |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 75 | - 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: |
kerenj | 81c063d | 2018-02-25 09:10:45 +0000 | [diff] [blame] | 85 | path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/ |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 86 | - name: elasticsearch-conf |
| 87 | configMap: |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 88 | name: log-elasticsearch-configmap |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 89 | items: |
| 90 | - key: elasticsearch.yml |
| 91 | path: elasticsearch.yml |
| 92 | --- |
| 93 | apiVersion: v1 |
| 94 | kind: ConfigMap |
| 95 | metadata: |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 96 | name: log-elasticsearch-configmap |
| 97 | namespace: {{ .Values.nsPrefix }} |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 98 | data: |
yuryn | fcef994 | 2017-10-26 17:10:50 +0300 | [diff] [blame] | 99 | {{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }} |
BorislavG | 2631be8 | 2017-11-01 12:48:42 +0200 | [diff] [blame] | 100 | #{{ end }} |
| 101 | |