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: |
Edwin Lawrance | a1dd587 | 2019-03-05 10:30:33 +0000 | [diff] [blame] | 37 | hostname: {{ include "common.name" . }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 38 | initContainers: |
| 39 | - command: |
| 40 | - /bin/sh |
| 41 | - -c |
| 42 | - | |
Julien Barbot | 5a5321f | 2018-10-23 09:54:45 +0200 | [diff] [blame] | 43 | sysctl -w vm.max_map_count=262144 |
Edwin Lawrance | 0d4b4b5 | 2018-08-02 15:57:13 +0100 | [diff] [blame] | 44 | mkdir -p /logroot/elasticsearch/logs |
| 45 | mkdir -p /logroot/elasticsearch/data |
| 46 | chmod -R 777 /logroot/elasticsearch |
| 47 | chown -R 1000:1000 /logroot |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 48 | env: |
| 49 | - name: NAMESPACE |
| 50 | valueFrom: |
| 51 | fieldRef: |
| 52 | apiVersion: v1 |
| 53 | fieldPath: metadata.namespace |
| 54 | securityContext: |
| 55 | privileged: true |
| 56 | image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }} |
Edwin Lawrance | a1dd587 | 2019-03-05 10:30:33 +0000 | [diff] [blame] | 57 | imagePullPolicy: {{ .Values.pullPolicy | default .Values.global.pullPolicy }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 58 | name: init-sysctl |
| 59 | volumeMounts: |
| 60 | - name: elasticsearch-data |
| 61 | mountPath: /logroot/ |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 62 | containers: |
| 63 | - name: {{ include "common.name" . }} |
Edwin Lawrance | a1dd587 | 2019-03-05 10:30:33 +0000 | [diff] [blame] | 64 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 65 | imagePullPolicy: {{ .Values.pullPolicy | default .Values.global.pullPolicy }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 66 | ports: |
| 67 | - containerPort: {{ .Values.service.internalPort }} |
Edwin Lawrance | a1dd587 | 2019-03-05 10:30:33 +0000 | [diff] [blame] | 68 | - containerPort: {{ .Values.service.internalPort2 }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 69 | # disable liveness probe when breakpoints set in debugger |
| 70 | # so K8s doesn't restart unresponsive container |
| 71 | {{- if eq .Values.liveness.enabled true }} |
| 72 | livenessProbe: |
| 73 | tcpSocket: |
| 74 | port: {{ .Values.service.internalPort }} |
| 75 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 76 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 77 | {{ end -}} |
| 78 | readinessProbe: |
| 79 | tcpSocket: |
| 80 | port: {{ .Values.service.internalPort }} |
| 81 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 82 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 83 | volumeMounts: |
| 84 | - name: localtime |
| 85 | mountPath: /etc/localtime |
| 86 | readOnly: true |
| 87 | - name: elasticsearch-config |
| 88 | subPath: elasticsearch.yml |
| 89 | mountPath: /usr/share/elasticsearch/config/elasticsearch.yml |
Edwin Lawrance | 0d4b4b5 | 2018-08-02 15:57:13 +0100 | [diff] [blame] | 90 | - name: elasticsearch-config |
| 91 | subPath: jvm.options |
| 92 | mountPath: /usr/share/elasticsearch/config/jvm.options |
| 93 | - name: elasticsearch-config |
| 94 | subPath: log4j2.properties |
| 95 | mountPath: /usr/share/elasticsearch/config/log4j2.properties |
Edwin Lawrance | a1dd587 | 2019-03-05 10:30:33 +0000 | [diff] [blame] | 96 | - name: searchguard-scripts |
| 97 | subPath: run.sh |
| 98 | mountPath: /usr/share/elasticsearch/bin/run.sh |
| 99 | - name: searchguard-scripts |
| 100 | subPath: wait_until_started.sh |
| 101 | mountPath: /usr/share/elasticsearch/bin/wait_until_started.sh |
| 102 | - name: searchguard-scripts |
| 103 | subPath: init_sg.sh |
| 104 | mountPath: /usr/share/elasticsearch/bin/init_sg.sh |
| 105 | - name: searchguard-config |
| 106 | mountPath: /usr/share/elasticsearch/config/sg |
| 107 | - name: searchguard-auth-config |
| 108 | mountPath: /usr/share/elasticsearch/config/sg/auth |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 109 | - name: elasticsearch-data |
| 110 | mountPath: /usr/share/elasticsearch/data |
| 111 | resources: |
Edwin Lawrance | a1dd587 | 2019-03-05 10:30:33 +0000 | [diff] [blame] | 112 | {{ include "common.resources" . | indent 12 }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 113 | {{- if .Values.nodeSelector }} |
| 114 | nodeSelector: |
| 115 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 116 | {{- end -}} |
| 117 | {{- if .Values.affinity }} |
| 118 | affinity: |
| 119 | {{ toYaml .Values.affinity | indent 8 }} |
| 120 | {{- end }} |
| 121 | |
| 122 | volumes: |
| 123 | - name: localtime |
| 124 | hostPath: |
| 125 | path: /etc/localtime |
| 126 | - name: elasticsearch-config |
| 127 | configMap: |
Edwin Lawrance | a1dd587 | 2019-03-05 10:30:33 +0000 | [diff] [blame] | 128 | name: {{ include "common.fullname" . }}-es-config |
| 129 | - name: searchguard-scripts |
| 130 | configMap: |
| 131 | name: {{ include "common.fullname" . }}-sg-scripts |
| 132 | defaultMode: 0754 |
| 133 | - name: searchguard-config |
| 134 | configMap: |
| 135 | name: {{ include "common.fullname" . }}-sg-config |
| 136 | - name: searchguard-auth-config |
| 137 | secret: |
| 138 | secretName: {{ include "common.fullname" . }}-sg-auth |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 139 | - name: elasticsearch-data |
| 140 | hostPath: |
BorislavG | 56857c4 | 2018-05-03 14:29:51 +0000 | [diff] [blame] | 141 | path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }} |
Edwin Lawrance | a1dd587 | 2019-03-05 10:30:33 +0000 | [diff] [blame] | 142 | restartPolicy: {{ .Values.restartPolicy }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 143 | imagePullSecrets: |
| 144 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |