Jakub Latusek | c586acb | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
Mukul | 7de56c8 | 2018-09-04 08:03:27 +0000 | [diff] [blame] | 3 | # Modifications Copyright © 2018 AT&T |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Jakub Latusek | c586acb | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 17 | |
Sylvain Desbureaux | 9a99424 | 2020-11-21 22:25:10 +0100 | [diff] [blame] | 18 | apiVersion: apps/v1 |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 19 | kind: Deployment |
| 20 | metadata: |
| 21 | name: {{ include "common.fullname" . }} |
| 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
| 24 | app: {{ include "common.name" . }} |
| 25 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 26 | release: {{ include "common.release" . }} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 27 | heritage: {{ .Release.Service }} |
| 28 | spec: |
| 29 | replicas: {{ .Values.replicaCount }} |
| 30 | template: |
| 31 | metadata: |
| 32 | labels: |
| 33 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 34 | release: {{ include "common.release" . }} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 35 | spec: |
| 36 | initContainers: |
| 37 | - command: |
| 38 | - /bin/sh |
| 39 | - -c |
| 40 | - | |
| 41 | sysctl -w vm.max_map_count=262144 |
| 42 | mkdir -p /logroot/elasticsearch/logs |
| 43 | mkdir -p /logroot/elasticsearch/data |
| 44 | chmod -R 777 /logroot/elasticsearch |
| 45 | chown -R root:root /logroot |
| 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
| 52 | securityContext: |
| 53 | privileged: true |
Sylvain Desbureaux | 9a99424 | 2020-11-21 22:25:10 +0100 | [diff] [blame] | 54 | image: {{ include "repositoryGenerator.image.busybox" . }} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 55 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 56 | name: init-sysctl |
| 57 | volumeMounts: |
| 58 | - name: {{ include "common.fullname" . }}-logs |
| 59 | mountPath: /logroot/ |
| 60 | containers: |
| 61 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 9a99424 | 2020-11-21 22:25:10 +0100 | [diff] [blame] | 62 | image: {{ include "repositoryGenerator.elasticRepository" . }}/{{ .Values.image }} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 63 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
vaibhavjayas | 659fbae | 2018-09-19 08:58:10 +0000 | [diff] [blame] | 64 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 65 | {{ include "common.resources" . | indent 12 }} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 66 | ports: |
| 67 | - containerPort: {{ .Values.service.internalPort }} |
| 68 | name: {{ .Values.service.name }} |
BorislavG | 2cf2684 | 2018-04-08 17:50:07 +0300 | [diff] [blame] | 69 | - containerPort: {{ .Values.service.internalPort2 }} |
| 70 | name: {{ .Values.service.name2 }} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 71 | # disable liveness probe when breakpoints set in debugger |
| 72 | # so K8s doesn't restart unresponsive container |
| 73 | {{- if eq .Values.liveness.enabled true }} |
| 74 | livenessProbe: |
| 75 | tcpSocket: |
| 76 | port: {{ .Values.service.internalPort }} |
| 77 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 78 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 79 | {{ end -}} |
| 80 | readinessProbe: |
| 81 | tcpSocket: |
BorislavG | 2cf2684 | 2018-04-08 17:50:07 +0300 | [diff] [blame] | 82 | port: {{ .Values.service.internalPort2 }} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 83 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 84 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 85 | env: |
| 86 | volumeMounts: |
| 87 | - mountPath: /etc/localtime |
| 88 | name: localtime |
| 89 | readOnly: true |
| 90 | - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml |
| 91 | name: {{ include "common.fullname" . }}-config |
| 92 | subPath: elasticsearch.yml |
| 93 | - mountPath: /usr/share/elasticsearch/data/ |
| 94 | name: {{ include "common.fullname" . }}-data |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 95 | volumes: |
| 96 | - name: localtime |
| 97 | hostPath: |
| 98 | path: /etc/localtime |
| 99 | - name: {{ include "common.fullname" . }}-config |
| 100 | configMap: |
| 101 | name: {{ include "common.fullname" . }}-configmap |
| 102 | items: |
| 103 | - key: elasticsearch.yml |
| 104 | path: elasticsearch.yml |
| 105 | - name: {{ include "common.fullname" . }}-data |
| 106 | persistentVolumeClaim: |
| 107 | claimName: {{ include "common.fullname" . }} |
| 108 | - name: {{ include "common.fullname" . }}-logs |
| 109 | hostPath: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 110 | path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPathLogs }} |
BorislavG | 5f3b619 | 2018-03-25 18:12:38 +0300 | [diff] [blame] | 111 | imagePullSecrets: |
| 112 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |