blob: 7258784f09d44a9d9528c53d3cfb3e3c0af51538 [file] [log] [blame]
Jakub Latusek2bd138d2020-10-21 13:36:29 +02001{{/*
Geora Barskya3f067c2018-07-19 16:46:37 -04002# 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 Latusek2bd138d2020-10-21 13:36:29 +020015*/}}
Geora Barskya3f067c2018-07-19 16:46:37 -040016
17apiVersion: extensions/v1beta1
18kind: Deployment
19metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Geora Barskya3f067c2018-07-19 16:46:37 -040026 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
Geora Barskya3f067c2018-07-19 16:46:37 -040034 spec:
35 initContainers:
36 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020037 - /app/ready.py
Geora Barskya3f067c2018-07-19 16:46:37 -040038 args:
39 - --container-name
40 - pomba-elasticsearch
41 env:
42 - name: NAMESPACE
43 valueFrom:
44 fieldRef:
45 apiVersion: v1
46 fieldPath: metadata.namespace
Sylvain Desbureaux93ed0752020-11-21 21:22:18 +010047 image: {{ include "repositoryGenerator.image.readiness" . }}
Geora Barskya3f067c2018-07-19 16:46:37 -040048 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
Sylvain Desbureaux93ed0752020-11-21 21:22:18 +010060 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.configImage }}
Geora Barskya3f067c2018-07-19 16:46:37 -040061 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
Sylvain Desbureaux93ed0752020-11-21 21:22:18 +010077 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.configImage }}
Geora Barskya3f067c2018-07-19 16:46:37 -040078 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 Barskya3f067c2018-07-19 16:46:37 -040084 containers:
85 - name: {{ include "common.name" . }}
Sylvain Desbureaux93ed0752020-11-21 21:22:18 +010086 image: {{ include "repositoryGenerator.elasticRepository" . }}/{{ .Values.image }}
Geora Barskya3f067c2018-07-19 16:46:37 -040087 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -050088 command: ["/bin/bash"]
89 args: ["-c", "/opt/app/bin/kibana_start.sh"]
Geora Barskya3f067c2018-07-19 16:46:37 -040090 ports:
91 - containerPort: {{ .Values.service.internalPort }}
92 name: {{ .Values.service.name }}
93 readinessProbe:
94 httpGet:
95 path: "/"
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -050096 scheme: "HTTPS"
Geora Barskya3f067c2018-07-19 16:46:37 -040097 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)420c6e22018-12-14 20:33:42 -0500107 scheme: "HTTPS"
Geora Barskya3f067c2018-07-19 16:46:37 -0400108 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)420c6e22018-12-14 20:33:42 -0500118 - mountPath: /usr/share/kibana/config
Geora Barskya3f067c2018-07-19 16:46:37 -0400119 name: {{ include "common.fullname" . }}
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -0500120 - mountPath: /opt/app/auth
121 name: {{ include "common.fullname" . }}-auth
122 - mountPath: /opt/app/bin
123 name: {{ include "common.fullname" . }}-bin
Geora Barskya3f067c2018-07-19 16:46:37 -0400124 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000125{{ include "common.resources" . | indent 12 }}
Geora Barskya3f067c2018-07-19 16:46:37 -0400126 {{- 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)420c6e22018-12-14 20:33:42 -0500145 path: default.json
Geora Barskya3f067c2018-07-19 16:46:37 -0400146 - key: default-mapping.json
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -0500147 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 Barskya3f067c2018-07-19 16:46:37 -0400156 imagePullSecrets:
157 - name: "{{ include "common.namespace" . }}-docker-registry-key"