blob: ef8b38fc10986da785ba1ad841ac9bbb9ea90386 [file] [log] [blame]
Mike Elliott37cae252018-09-12 14:45:40 -04001# Copyright (c) 2018 Amdocs, Bell Canada
2#
Steve Alphonse Sianie20fd5e2019-01-25 16:16:29 -05003# Modifications Copyright (c) 2019 IBM, Bell Canada
4#
Mike Elliott37cae252018-09-12 14:45:40 -04005# 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.
16
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 "+" "_" }}
25 release: {{ .Release.Name }}
26 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
33 release: {{ .Release.Name }}
34 spec:
35 initContainers:
36 - command:
37 - /root/ready.py
38 args:
39 - --container-name
40 - {{ index .Values "mariadb-galera" "nameOverride" }}
41 env:
42 - name: NAMESPACE
43 valueFrom:
44 fieldRef:
45 apiVersion: v1
46 fieldPath: metadata.namespace
47 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
48 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49 name: {{ include "common.name" . }}-readiness
50 containers:
51 - name: {{ include "common.name" . }}
52 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
53 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Steve Alphonse Sianie20fd5e2019-01-25 16:16:29 -050054 env:
55 - name: APP_CONFIG_HOME
56 value: {{ .Values.config.appConfigDir }}
Mike Elliott37cae252018-09-12 14:45:40 -040057 ports:
58 - containerPort: {{ .Values.service.internalPort }}
59 # disable liveness probe when breakpoints set in debugger
60 # so K8s doesn't restart unresponsive container
61 {{ if .Values.liveness.enabled }}
62 livenessProbe:
63 tcpSocket:
64 port: {{ .Values.service.internalPort }}
65 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
66 periodSeconds: {{ .Values.liveness.periodSeconds }}
67 {{ end }}
68 readinessProbe:
69 tcpSocket:
70 port: {{ .Values.service.internalPort }}
71 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.readiness.periodSeconds }}
Mike Elliott37cae252018-09-12 14:45:40 -040073 volumeMounts:
74 - mountPath: /etc/localtime
75 name: localtime
76 readOnly: true
77 - mountPath: {{ .Values.config.appConfigDir }}/application.properties
78 name: {{ include "common.fullname" . }}-config
79 subPath: application.properties
80 - mountPath: {{ .Values.config.appConfigDir }}/logback.xml
81 name: {{ include "common.fullname" . }}-config
82 subPath: logback.xml
83 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000084{{ include "common.resources" . | indent 12 }}
Mike Elliott37cae252018-09-12 14:45:40 -040085 {{- if .Values.nodeSelector }}
86 nodeSelector:
87{{ toYaml .Values.nodeSelector | indent 10 }}
88 {{- end -}}
89 {{- if .Values.affinity }}
90 affinity:
91{{ toYaml .Values.affinity | indent 10 }}
92 {{- end }}
Mike Elliott37cae252018-09-12 14:45:40 -040093 volumes:
94 - name: localtime
95 hostPath:
96 path: /etc/localtime
97 - name: {{ include "common.fullname" . }}-config
98 configMap:
99 name: {{ include "common.fullname" . }}-configmap
100 items:
101 - key: application.properties
102 path: application.properties
103 - key: logback.xml
104 path: logback.xml
105 imagePullSecrets:
106 - name: "{{ include "common.namespace" . }}-docker-registry-key"