toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 1 | # Copyright © 2018 Amdocs, Bell Canada, AT&T |
| 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 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 15 | apiVersion: extensions/v1beta1 |
| 16 | kind: Deployment |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }} |
| 19 | namespace: {{ include "common.namespace" . }} |
| 20 | labels: |
| 21 | app: {{ include "common.name" . }} |
| 22 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 23 | release: {{ .Release.Name }} |
| 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
| 26 | replicas: {{ .Values.replicaCount }} |
| 27 | selector: |
| 28 | matchLabels: |
| 29 | app: {{ include "common.name" . }} |
| 30 | template: |
| 31 | metadata: |
| 32 | labels: |
| 33 | app: {{ include "common.name" . }} |
Arul.Nambi | b8c668f | 2018-07-17 16:02:30 -0400 | [diff] [blame] | 34 | release: {{ .Release.Name }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 35 | name: {{ include "common.name" . }} |
| 36 | spec: |
| 37 | initContainers: |
| 38 | - command: |
| 39 | - /bin/sh |
| 40 | - -c |
| 41 | - | |
Julien Barbot | 5a5321f | 2018-10-23 09:54:45 +0200 | [diff] [blame] | 42 | sysctl -w vm.max_map_count=262144 |
Edwin Lawrance | 0d4b4b5 | 2018-08-02 15:57:13 +0100 | [diff] [blame] | 43 | mkdir -p /logroot/elasticsearch/logs |
| 44 | mkdir -p /logroot/elasticsearch/data |
| 45 | chmod -R 777 /logroot/elasticsearch |
| 46 | chown -R 1000:1000 /logroot |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 47 | env: |
| 48 | - name: NAMESPACE |
| 49 | valueFrom: |
| 50 | fieldRef: |
| 51 | apiVersion: v1 |
| 52 | fieldPath: metadata.namespace |
| 53 | securityContext: |
| 54 | privileged: true |
| 55 | image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }} |
| 56 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 57 | name: init-sysctl |
| 58 | volumeMounts: |
| 59 | - name: elasticsearch-data |
| 60 | mountPath: /logroot/ |
| 61 | hostname: {{ include "common.name" . }} |
| 62 | containers: |
| 63 | - name: {{ include "common.name" . }} |
Edwin Lawrance | 0d4b4b5 | 2018-08-02 15:57:13 +0100 | [diff] [blame] | 64 | image: {{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 65 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 66 | ports: |
| 67 | - containerPort: {{ .Values.service.internalPort }} |
| 68 | # disable liveness probe when breakpoints set in debugger |
| 69 | # so K8s doesn't restart unresponsive container |
| 70 | {{- if eq .Values.liveness.enabled true }} |
| 71 | livenessProbe: |
| 72 | tcpSocket: |
| 73 | port: {{ .Values.service.internalPort }} |
| 74 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 75 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 76 | {{ end -}} |
| 77 | readinessProbe: |
| 78 | tcpSocket: |
| 79 | port: {{ .Values.service.internalPort }} |
| 80 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 81 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 82 | volumeMounts: |
| 83 | - name: localtime |
| 84 | mountPath: /etc/localtime |
| 85 | readOnly: true |
| 86 | - name: elasticsearch-config |
| 87 | subPath: elasticsearch.yml |
| 88 | mountPath: /usr/share/elasticsearch/config/elasticsearch.yml |
Edwin Lawrance | 0d4b4b5 | 2018-08-02 15:57:13 +0100 | [diff] [blame] | 89 | - name: elasticsearch-config |
| 90 | subPath: jvm.options |
| 91 | mountPath: /usr/share/elasticsearch/config/jvm.options |
| 92 | - name: elasticsearch-config |
| 93 | subPath: log4j2.properties |
| 94 | mountPath: /usr/share/elasticsearch/config/log4j2.properties |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 95 | - name: elasticsearch-data |
| 96 | mountPath: /usr/share/elasticsearch/data |
| 97 | resources: |
kranthikirang | cb25a53 | 2018-12-07 16:12:02 -0500 | [diff] [blame] | 98 | {{ include "common.resources" . }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 99 | {{- if .Values.nodeSelector }} |
| 100 | nodeSelector: |
| 101 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 102 | {{- end -}} |
| 103 | {{- if .Values.affinity }} |
| 104 | affinity: |
| 105 | {{ toYaml .Values.affinity | indent 8 }} |
| 106 | {{- end }} |
| 107 | |
| 108 | volumes: |
| 109 | - name: localtime |
| 110 | hostPath: |
| 111 | path: /etc/localtime |
| 112 | - name: elasticsearch-config |
| 113 | configMap: |
| 114 | name: {{ include "common.fullname" . }} |
| 115 | - name: elasticsearch-data |
| 116 | hostPath: |
BorislavG | 56857c4 | 2018-05-03 14:29:51 +0000 | [diff] [blame] | 117 | path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 118 | imagePullSecrets: |
| 119 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |