blob: 7e4ad5bd9257fc701eb915c706efdaf0f2ac51d0 [file] [log] [blame]
Jakub Latusek0ef82312020-10-21 13:36:30 +02001{{/*
jasmineWen66f6a3b2018-04-03 17:48:41 +00002# 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 Latusek0ef82312020-10-21 13:36:30 +020015*/}}
jasmineWen66f6a3b2018-04-03 17:48:41 +000016
Grzegorz-Lis8fc16112020-07-30 11:51:34 +020017apiVersion: apps/v1
jasmineWen66f6a3b2018-04-03 17:48:41 +000018kind: 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" . }}
jasmineWen66f6a3b2018-04-03 17:48:41 +000026 heritage: {{ .Release.Service }}
27spec:
28 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010035 release: {{ include "common.release" . }}
jasmineWen66f6a3b2018-04-03 17:48:41 +000036 name: {{ include "common.name" . }}
37 spec:
38 initContainers:
39 - command:
Krzysztof Opasiak79677d32020-05-05 01:42:23 +020040 - sh
41 args:
42 - -c
43 - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
44 env:
45 - name: PG_USER
46 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
47 - name: PG_PASSWORD
48 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
49 volumeMounts:
50 - mountPath: /config-input
51 name: init-data-input
52 - mountPath: /config
53 name: init-data
Sylvain Desbureaux50f9c5d2020-11-19 17:25:17 +010054 image: {{ include "repositoryGenerator.image.envsubst" . }}
Krzysztof Opasiak79677d32020-05-05 01:42:23 +020055 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 name: {{ include "common.name" . }}-update-config
57
58 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020059 - /app/ready.py
jasmineWen66f6a3b2018-04-03 17:48:41 +000060 args:
61 - --container-name
jasmineWenfb56f0f2018-08-29 15:55:28 +000062 - "{{ .Values.postgres.nameOverride }}"
jasmineWen66f6a3b2018-04-03 17:48:41 +000063 env:
64 - name: NAMESPACE
65 valueFrom:
66 fieldRef:
67 apiVersion: v1
68 fieldPath: metadata.namespace
Sylvain Desbureaux50f9c5d2020-11-19 17:25:17 +010069 image: {{ include "repositoryGenerator.image.readiness" . }}
dkamdocs6ad3a1c2018-12-21 09:25:53 +000070 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
jasmineWen66f6a3b2018-04-03 17:48:41 +000071 name: {{ include "common.name" . }}-readiness
72 containers:
Sylvain Desbureaux50f9c5d2020-11-19 17:25:17 +010073 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
dkamdocs6ad3a1c2018-12-21 09:25:53 +000074 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
jasmineWen66f6a3b2018-04-03 17:48:41 +000075 name: {{ include "common.name" . }}
vaibhav_16dec0acf5182018-09-19 04:28:55 +000076 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000077{{ include "common.resources" . | indent 12 }}
Jakub Latusek1e273d02020-09-28 15:52:40 +020078 volumeMounts:
Krzysztof Opasiak79677d32020-05-05 01:42:23 +020079 - mountPath: /service/webapps/ROOT/WEB-INF/classes/mybatis/configuration/configuration.xml
80 name: init-data
81 subPath: configuration.xml
jasmineWen66f6a3b2018-04-03 17:48:41 +000082 readinessProbe:
83 tcpSocket:
84 port: {{ .Values.service.internalPort }}
85 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
86 periodSeconds: {{ .Values.readiness.periodSeconds }}
87 imagePullSecrets:
88 - name: "{{ include "common.namespace" . }}-docker-registry-key"
Krzysztof Opasiak79677d32020-05-05 01:42:23 +020089 volumes:
90 - name: init-data-input
91 configMap:
92 name: {{ include "common.fullname" . }}
93 - name: init-data
94 emptyDir:
95 medium: Memory