blob: 58a0a90acf8c2ca97d36da62c92f87af54e11a9f [file] [log] [blame]
Geora Barskya3f067c2018-07-19 16:46:37 -04001# 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 - pomba-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 - args:
49 - --output=http://{{.Values.config.elasticsearchServiceName}}.{{ include "common.namespace" . }}:{{.Values.config.elasticsearchPort}}/.kibana
50 - --input=/config/default-mapping.json
51 - --type=mapping
52 env:
53 - name: NAMESPACE
54 valueFrom:
55 fieldRef:
56 apiVersion: v1
57 fieldPath: metadata.namespace
58 image: "{{ .Values.configRepository }}/{{ .Values.configImage }}"
59 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 name: {{ include "common.name" . }}-config-map
61 volumeMounts:
62 - mountPath: /config/default-mapping.json
63 name: {{ include "common.fullname" . }}
64 subPath: default-mapping.json
65 - args:
66 - --output=http://{{.Values.config.elasticsearchServiceName}}.{{ include "common.namespace" . }}:{{.Values.config.elasticsearchPort}}/.kibana
67 - --input=/config/default.json
68 - --type=data
69 env:
70 - name: NAMESPACE
71 valueFrom:
72 fieldRef:
73 apiVersion: v1
74 fieldPath: metadata.namespace
75 image: "{{ .Values.configRepository }}/{{ .Values.configImage }}"
76 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77 name: {{ include "common.name" . }}-config
78 volumeMounts:
79 - mountPath: /config/default.json
80 name: {{ include "common.fullname" . }}
81 subPath: default.json
Geora Barskya3f067c2018-07-19 16:46:37 -040082 containers:
83 - name: {{ include "common.name" . }}
84 image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}"
85 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -050086 command: ["/bin/bash"]
87 args: ["-c", "/opt/app/bin/kibana_start.sh"]
Geora Barskya3f067c2018-07-19 16:46:37 -040088 ports:
89 - containerPort: {{ .Values.service.internalPort }}
90 name: {{ .Values.service.name }}
91 readinessProbe:
92 httpGet:
93 path: "/"
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -050094 scheme: "HTTPS"
Geora Barskya3f067c2018-07-19 16:46:37 -040095 port: {{ .Values.service.internalPort }}
96 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
97 periodSeconds: {{ .Values.readiness.periodSeconds }}
98 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
99# disable liveness probe when breakpoints set in debugger
100 # so K8s doesn't restart unresponsive container
101 {{- if eq .Values.liveness.enabled true }}
102 livenessProbe:
103 httpGet:
104 path: "/"
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -0500105 scheme: "HTTPS"
Geora Barskya3f067c2018-07-19 16:46:37 -0400106 port: {{ .Values.service.internalPort }}
107 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
108 periodSeconds: {{ .Values.liveness.periodSeconds }}
109 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
110 {{ end -}}
111 env:
112 volumeMounts:
113 - mountPath: /etc/localtime
114 name: localtime
115 readOnly: true
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -0500116 - mountPath: /usr/share/kibana/config
Geora Barskya3f067c2018-07-19 16:46:37 -0400117 name: {{ include "common.fullname" . }}
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -0500118 - mountPath: /opt/app/auth
119 name: {{ include "common.fullname" . }}-auth
120 - mountPath: /opt/app/bin
121 name: {{ include "common.fullname" . }}-bin
Geora Barskya3f067c2018-07-19 16:46:37 -0400122 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000123{{ include "common.resources" . | indent 12 }}
Geora Barskya3f067c2018-07-19 16:46:37 -0400124 {{- if .Values.nodeSelector }}
125 nodeSelector:
126{{ toYaml .Values.nodeSelector | indent 10 }}
127 {{- end -}}
128 {{- if .Values.affinity }}
129 affinity:
130{{ toYaml .Values.affinity | indent 10 }}
131 {{- end }}
132 volumes:
133 - name: localtime
134 hostPath:
135 path: /etc/localtime
136 - name: {{ include "common.fullname" . }}
137 configMap:
138 name: {{ include "common.fullname" . }}
139 items:
140 - key: kibana.yml
141 path: kibana.yml
142 - key: default.json
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -0500143 path: default.json
Geora Barskya3f067c2018-07-19 16:46:37 -0400144 - key: default-mapping.json
Leigh, Phillip (pl876u)420c6e22018-12-14 20:33:42 -0500145 path: default-mapping.json
146 - name: {{ include "common.fullname" . }}-auth
147 configMap:
148 name: {{ include "common.fullname" . }}-auth
149 defaultMode: 0777
150 - name: {{ include "common.fullname" . }}-bin
151 configMap:
152 name: {{ include "common.fullname" . }}-bin
153 defaultMode: 0777
Geora Barskya3f067c2018-07-19 16:46:37 -0400154 imagePullSecrets:
155 - name: "{{ include "common.namespace" . }}-docker-registry-key"