Jakub Latusek | 2bd138d | 2020-10-21 13:36:29 +0200 | [diff] [blame^] | 1 | {{/* |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Jakub Latusek | 2bd138d | 2020-10-21 13:36:29 +0200 | [diff] [blame^] | 15 | */}} |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 16 | |
| 17 | apiVersion: extensions/v1beta1 |
| 18 | kind: Deployment |
| 19 | metadata: |
| 20 | name: {{ include "common.fullname" . }} |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }} |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | replicas: {{ .Values.replicaCount }} |
| 29 | template: |
| 30 | metadata: |
| 31 | labels: |
| 32 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 33 | release: {{ include "common.release" . }} |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 34 | spec: |
| 35 | initContainers: |
| 36 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 37 | - /app/ready.py |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 38 | args: |
| 39 | - --container-name |
| 40 | - pomba-elasticsearch |
| 41 | env: |
| 42 | - name: NAMESPACE |
| 43 | valueFrom: |
| 44 | fieldRef: |
| 45 | apiVersion: v1 |
| 46 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 47 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 48 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 49 | name: {{ include "common.name" . }}-readiness |
| 50 | - args: |
| 51 | - --output=http://{{.Values.config.elasticsearchServiceName}}.{{ include "common.namespace" . }}:{{.Values.config.elasticsearchPort}}/.kibana |
| 52 | - --input=/config/default-mapping.json |
| 53 | - --type=mapping |
| 54 | env: |
| 55 | - name: NAMESPACE |
| 56 | valueFrom: |
| 57 | fieldRef: |
| 58 | apiVersion: v1 |
| 59 | fieldPath: metadata.namespace |
| 60 | image: "{{ .Values.configRepository }}/{{ .Values.configImage }}" |
| 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 62 | name: {{ include "common.name" . }}-config-map |
| 63 | volumeMounts: |
| 64 | - mountPath: /config/default-mapping.json |
| 65 | name: {{ include "common.fullname" . }} |
| 66 | subPath: default-mapping.json |
| 67 | - args: |
| 68 | - --output=http://{{.Values.config.elasticsearchServiceName}}.{{ include "common.namespace" . }}:{{.Values.config.elasticsearchPort}}/.kibana |
| 69 | - --input=/config/default.json |
| 70 | - --type=data |
| 71 | env: |
| 72 | - name: NAMESPACE |
| 73 | valueFrom: |
| 74 | fieldRef: |
| 75 | apiVersion: v1 |
| 76 | fieldPath: metadata.namespace |
| 77 | image: "{{ .Values.configRepository }}/{{ .Values.configImage }}" |
| 78 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 79 | name: {{ include "common.name" . }}-config |
| 80 | volumeMounts: |
| 81 | - mountPath: /config/default.json |
| 82 | name: {{ include "common.fullname" . }} |
| 83 | subPath: default.json |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 84 | containers: |
| 85 | - name: {{ include "common.name" . }} |
| 86 | image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}" |
| 87 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Leigh, Phillip (pl876u) | 420c6e2 | 2018-12-14 20:33:42 -0500 | [diff] [blame] | 88 | command: ["/bin/bash"] |
| 89 | args: ["-c", "/opt/app/bin/kibana_start.sh"] |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 90 | ports: |
| 91 | - containerPort: {{ .Values.service.internalPort }} |
| 92 | name: {{ .Values.service.name }} |
| 93 | readinessProbe: |
| 94 | httpGet: |
| 95 | path: "/" |
Leigh, Phillip (pl876u) | 420c6e2 | 2018-12-14 20:33:42 -0500 | [diff] [blame] | 96 | scheme: "HTTPS" |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 97 | port: {{ .Values.service.internalPort }} |
| 98 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 99 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 100 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
| 101 | # disable liveness probe when breakpoints set in debugger |
| 102 | # so K8s doesn't restart unresponsive container |
| 103 | {{- if eq .Values.liveness.enabled true }} |
| 104 | livenessProbe: |
| 105 | httpGet: |
| 106 | path: "/" |
Leigh, Phillip (pl876u) | 420c6e2 | 2018-12-14 20:33:42 -0500 | [diff] [blame] | 107 | scheme: "HTTPS" |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 108 | port: {{ .Values.service.internalPort }} |
| 109 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 110 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 111 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
| 112 | {{ end -}} |
| 113 | env: |
| 114 | volumeMounts: |
| 115 | - mountPath: /etc/localtime |
| 116 | name: localtime |
| 117 | readOnly: true |
Leigh, Phillip (pl876u) | 420c6e2 | 2018-12-14 20:33:42 -0500 | [diff] [blame] | 118 | - mountPath: /usr/share/kibana/config |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 119 | name: {{ include "common.fullname" . }} |
Leigh, Phillip (pl876u) | 420c6e2 | 2018-12-14 20:33:42 -0500 | [diff] [blame] | 120 | - mountPath: /opt/app/auth |
| 121 | name: {{ include "common.fullname" . }}-auth |
| 122 | - mountPath: /opt/app/bin |
| 123 | name: {{ include "common.fullname" . }}-bin |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 124 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 125 | {{ include "common.resources" . | indent 12 }} |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 126 | {{- if .Values.nodeSelector }} |
| 127 | nodeSelector: |
| 128 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 129 | {{- end -}} |
| 130 | {{- if .Values.affinity }} |
| 131 | affinity: |
| 132 | {{ toYaml .Values.affinity | indent 10 }} |
| 133 | {{- end }} |
| 134 | volumes: |
| 135 | - name: localtime |
| 136 | hostPath: |
| 137 | path: /etc/localtime |
| 138 | - name: {{ include "common.fullname" . }} |
| 139 | configMap: |
| 140 | name: {{ include "common.fullname" . }} |
| 141 | items: |
| 142 | - key: kibana.yml |
| 143 | path: kibana.yml |
| 144 | - key: default.json |
Leigh, Phillip (pl876u) | 420c6e2 | 2018-12-14 20:33:42 -0500 | [diff] [blame] | 145 | path: default.json |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 146 | - key: default-mapping.json |
Leigh, Phillip (pl876u) | 420c6e2 | 2018-12-14 20:33:42 -0500 | [diff] [blame] | 147 | path: default-mapping.json |
| 148 | - name: {{ include "common.fullname" . }}-auth |
| 149 | configMap: |
| 150 | name: {{ include "common.fullname" . }}-auth |
| 151 | defaultMode: 0777 |
| 152 | - name: {{ include "common.fullname" . }}-bin |
| 153 | configMap: |
| 154 | name: {{ include "common.fullname" . }}-bin |
| 155 | defaultMode: 0777 |
Geora Barsky | a3f067c | 2018-07-19 16:46:37 -0400 | [diff] [blame] | 156 | imagePullSecrets: |
| 157 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |