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