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