yuryn | fcef994 | 2017-10-26 17:10:50 +0300 | [diff] [blame] | 1 | #{{ if not .Values.disableLogElasticsearch }} |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 2 | apiVersion: extensions/v1beta1 |
| 3 | kind: Deployment |
| 4 | metadata: |
| 5 | labels: |
| 6 | app: elasticsearch |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 7 | name: log-elasticsearch |
| 8 | namespace: {{ .Values.nsPrefix }} |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 9 | spec: |
vaibhav_16dec | b7d08b2 | 2018-02-16 06:33:55 +0000 | [diff] [blame^] | 10 | replicas: {{ .Values.elasticsearchReplicas }} |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 11 | selector: |
| 12 | matchLabels: |
| 13 | app: elasticsearch |
| 14 | template: |
| 15 | metadata: |
| 16 | labels: |
| 17 | app: elasticsearch |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 18 | name: log-elasticsearch |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 19 | spec: |
kiranya | 7a31821 | 2017-11-22 13:40:04 +0000 | [diff] [blame] | 20 | initContainers: |
| 21 | - command: |
mayankg2703 | d21b8b6 | 2018-01-18 16:58:09 +0000 | [diff] [blame] | 22 | - /bin/sh |
| 23 | - -c |
| 24 | - | |
| 25 | sysctl -w vm.max_map_count=262144 |
| 26 | mkdir -p /logroot/elasticsearch/logs |
| 27 | mkdir -p /logroot/elasticsearch/data |
| 28 | chmod -R 777 /logroot/elasticsearch |
| 29 | chown -R root:root /logroot |
kiranya | 7a31821 | 2017-11-22 13:40:04 +0000 | [diff] [blame] | 30 | env: |
| 31 | - name: NAMESPACE |
| 32 | valueFrom: |
| 33 | fieldRef: |
| 34 | apiVersion: v1 |
| 35 | fieldPath: metadata.namespace |
| 36 | securityContext: |
| 37 | privileged: true |
| 38 | image: {{ .Values.image.es_bb }} |
| 39 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 40 | name: init-sysctl |
mayankg2703 | d21b8b6 | 2018-01-18 16:58:09 +0000 | [diff] [blame] | 41 | volumeMounts: |
| 42 | - name: elasticsearch-logs |
| 43 | mountPath: /logroot/ |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 44 | containers: |
| 45 | - name: elasticsearch |
| 46 | image: {{ .Values.image.elasticsearch}} |
| 47 | ports: |
| 48 | - containerPort: 9200 |
| 49 | name: http |
| 50 | protocol: TCP |
| 51 | - containerPort: 9300 |
| 52 | name: transport |
| 53 | protocol: TCP |
| 54 | readinessProbe: |
| 55 | tcpSocket: |
BorislavG | 2631be8 | 2017-11-01 12:48:42 +0200 | [diff] [blame] | 56 | port: 9300 |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 57 | volumeMounts: |
BorislavG | 2631be8 | 2017-11-01 12:48:42 +0200 | [diff] [blame] | 58 | - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 59 | name: elasticsearch-conf |
BorislavG | 2631be8 | 2017-11-01 12:48:42 +0200 | [diff] [blame] | 60 | subPath: elasticsearch.yml |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 61 | - mountPath: /usr/share/elasticsearch/data/ |
| 62 | name: elasticsearch-data |
| 63 | - mountPath: /usr/share/elasticsearch/logs/ |
| 64 | name: elasticsearch-logs |
| 65 | volumes: |
| 66 | - name: elasticsearch-data |
| 67 | persistentVolumeClaim: |
| 68 | claimName: elasticsearch-db |
| 69 | - name: elasticsearch-logs |
| 70 | hostPath: |
kerenj | 81c063d | 2018-02-25 09:10:45 +0000 | [diff] [blame] | 71 | path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/ |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 72 | - name: elasticsearch-conf |
| 73 | configMap: |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 74 | name: log-elasticsearch-configmap |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 75 | items: |
| 76 | - key: elasticsearch.yml |
| 77 | path: elasticsearch.yml |
| 78 | --- |
| 79 | apiVersion: v1 |
| 80 | kind: ConfigMap |
| 81 | metadata: |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 82 | name: log-elasticsearch-configmap |
| 83 | namespace: {{ .Values.nsPrefix }} |
Itay Hassid | e2da86d | 2017-08-24 12:54:42 +0000 | [diff] [blame] | 84 | data: |
yuryn | fcef994 | 2017-10-26 17:10:50 +0300 | [diff] [blame] | 85 | {{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }} |
BorislavG | 2631be8 | 2017-11-01 12:48:42 +0200 | [diff] [blame] | 86 | #{{ end }} |
| 87 | |