blob: 09dc88fb20f8ca7755c0b87ba244a1ff1fe4f8e3 [file] [log] [blame]
BorislavG5f3b6192018-03-25 18:12:38 +03001# Copyright © 2017 Amdocs, Bell Canada
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
15apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
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 }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
31 release: {{ .Release.Name }}
32 spec:
33 initContainers:
34 - command:
35 - /root/ready.py
36 args:
37 - --container-name
38 - log-elasticsearch
39 env:
40 - name: NAMESPACE
41 valueFrom:
42 fieldRef:
43 apiVersion: v1
44 fieldPath: metadata.namespace
45 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
46 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47 name: {{ include "common.name" . }}-readiness
48 containers:
49 - name: {{ include "common.name" . }}
50 image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 ports:
53 - containerPort: {{ .Values.service.internalPort }}
54 name: {{ .Values.service.name }}
55 readinessProbe:
root457c65a2018-04-04 14:51:59 +000056 httpGet:
57 path: "/"
BorislavG5f3b6192018-03-25 18:12:38 +030058 port: {{ .Values.service.internalPort }}
59 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.readiness.periodSeconds }}
root457c65a2018-04-04 14:51:59 +000061 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
BorislavG5f3b6192018-03-25 18:12:38 +030062# disable liveness probe when breakpoints set in debugger
63 # so K8s doesn't restart unresponsive container
64 {{- if eq .Values.liveness.enabled true }}
65 livenessProbe:
root457c65a2018-04-04 14:51:59 +000066 httpGet:
67 path: "/"
BorislavG5f3b6192018-03-25 18:12:38 +030068 port: {{ .Values.service.internalPort }}
69 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
70 periodSeconds: {{ .Values.liveness.periodSeconds }}
root457c65a2018-04-04 14:51:59 +000071 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
BorislavG5f3b6192018-03-25 18:12:38 +030072 {{ end -}}
73 env:
74 volumeMounts:
75 - mountPath: /etc/localtime
76 name: localtime
77 readOnly: true
root457c65a2018-04-04 14:51:59 +000078 - mountPath: /usr/share/kibana/config/
BorislavG5f3b6192018-03-25 18:12:38 +030079 name: {{ include "common.fullname" . }}
BorislavG5f3b6192018-03-25 18:12:38 +030080 resources:
81{{ toYaml .Values.resources | indent 12 }}
82 {{- if .Values.nodeSelector }}
83 nodeSelector:
84{{ toYaml .Values.nodeSelector | indent 10 }}
85 {{- end -}}
86 {{- if .Values.affinity }}
87 affinity:
88{{ toYaml .Values.affinity | indent 10 }}
89 {{- end }}
90 volumes:
91 - name: localtime
92 hostPath:
93 path: /etc/localtime
94 - name: {{ include "common.fullname" . }}
95 configMap:
96 name: {{ include "common.fullname" . }}
97 items:
98 - key: kibana.yml
99 path: kibana.yml
100 imagePullSecrets:
101 - name: "{{ include "common.namespace" . }}-docker-registry-key"