blob: 4b0dcf1d3de3a192eeaf23c9d96567f486529bdb [file] [log] [blame]
Jakub Latusekc586acb2020-10-21 13:36:29 +02001{{/*
BorislavG5f3b6192018-03-25 18:12:38 +03002# Copyright © 2017 Amdocs, Bell Canada
Mukul7de56c82018-09-04 08:03:27 +00003# Modifications Copyright © 2018 AT&T
BorislavG5f3b6192018-03-25 18:12:38 +03004#
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 Latusekc586acb2020-10-21 13:36:29 +020016*/}}
BorislavG5f3b6192018-03-25 18:12:38 +030017
18apiVersion: extensions/v1beta1
19kind: Deployment
20metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
BorislavG5f3b6192018-03-25 18:12:38 +030027 heritage: {{ .Release.Service }}
28spec:
29 replicas: {{ .Values.replicaCount }}
30 template:
31 metadata:
32 labels:
33 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010034 release: {{ include "common.release" . }}
BorislavG5f3b6192018-03-25 18:12:38 +030035 spec:
36 initContainers:
37 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020038 - /app/ready.py
BorislavG5f3b6192018-03-25 18:12:38 +030039 args:
40 - --container-name
41 - log-elasticsearch
42 env:
43 - name: NAMESPACE
44 valueFrom:
45 fieldRef:
46 apiVersion: v1
47 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020048 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
BorislavG5f3b6192018-03-25 18:12:38 +030049 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50 name: {{ include "common.name" . }}-readiness
Artem Naluzhnyye02c2232019-05-31 11:18:30 +000051 - args:
52 - --input=/config/kibana-onboarding.json
53 - --output=http://{{.Values.config.elasticsearchServiceName}}.{{ include "common.namespace" . }}:{{.Values.config.elasticsearchPort}}/.kibana
54 env:
55 - name: NAMESPACE
56 valueFrom:
57 fieldRef:
58 apiVersion: v1
59 fieldPath: metadata.namespace
60 image: "{{ .Values.elasticdumpRepository }}/{{ .Values.elasticdumpImage }}"
61 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 name: {{ include "common.name" . }}-elasticdump
63 volumeMounts:
64 - mountPath: /config/kibana-onboarding.json
65 name: {{ include "common.fullname" . }}
66 subPath: kibana-onboarding.json
BorislavG5f3b6192018-03-25 18:12:38 +030067 containers:
68 - name: {{ include "common.name" . }}
69 image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}"
70 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
vaibhavjayas659fbae2018-09-19 08:58:10 +000071 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000072{{ include "common.resources" . | indent 12 }}
BorislavG5f3b6192018-03-25 18:12:38 +030073 ports:
74 - containerPort: {{ .Values.service.internalPort }}
75 name: {{ .Values.service.name }}
76 readinessProbe:
root457c65a2018-04-04 14:51:59 +000077 httpGet:
78 path: "/"
BorislavG5f3b6192018-03-25 18:12:38 +030079 port: {{ .Values.service.internalPort }}
80 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
81 periodSeconds: {{ .Values.readiness.periodSeconds }}
root457c65a2018-04-04 14:51:59 +000082 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
BorislavG5f3b6192018-03-25 18:12:38 +030083# disable liveness probe when breakpoints set in debugger
84 # so K8s doesn't restart unresponsive container
85 {{- if eq .Values.liveness.enabled true }}
86 livenessProbe:
root457c65a2018-04-04 14:51:59 +000087 httpGet:
88 path: "/"
BorislavG5f3b6192018-03-25 18:12:38 +030089 port: {{ .Values.service.internalPort }}
90 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
91 periodSeconds: {{ .Values.liveness.periodSeconds }}
root457c65a2018-04-04 14:51:59 +000092 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
BorislavG5f3b6192018-03-25 18:12:38 +030093 {{ end -}}
94 env:
95 volumeMounts:
96 - mountPath: /etc/localtime
97 name: localtime
98 readOnly: true
root457c65a2018-04-04 14:51:59 +000099 - mountPath: /usr/share/kibana/config/
BorislavG5f3b6192018-03-25 18:12:38 +0300100 name: {{ include "common.fullname" . }}
BorislavG5f3b6192018-03-25 18:12:38 +0300101 volumes:
102 - name: localtime
103 hostPath:
104 path: /etc/localtime
105 - name: {{ include "common.fullname" . }}
106 configMap:
107 name: {{ include "common.fullname" . }}
108 items:
109 - key: kibana.yml
110 path: kibana.yml
Artem Naluzhnyye02c2232019-05-31 11:18:30 +0000111 - key: kibana-onboarding.json
112 path: kibana-onboarding.json
BorislavG5f3b6192018-03-25 18:12:38 +0300113 imagePullSecrets:
114 - name: "{{ include "common.namespace" . }}-docker-registry-key"