blob: 7dd96926ceec0711b9699d80363c80a05bce16cc [file] [log] [blame]
mayankg2703ced85142018-03-20 05:42:53 +00001# Copyright © 2017 Amdocs, Bell Canada
Durgpal7ad40692018-08-03 07:28:36 +00002# Modifications Copyright © 2018 AT&T
mayankg2703ced85142018-03-20 05:42:53 +00003#
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.
15
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020016apiVersion: apps/v1
mayankg2703ced85142018-03-20 05:42:53 +000017kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
mayankg2703ced85142018-03-20 05:42:53 +000025 heritage: {{ .Release.Service }}
26spec:
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020027 selector:
28 matchLabels:
29 app: {{ include "common.name" . }}
mayankg2703ced85142018-03-20 05:42:53 +000030 replicas: {{ .Values.replicaCount }}
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010035 release: {{ include "common.release" . }}
mayankg2703ced85142018-03-20 05:42:53 +000036 spec:
37 initContainers:
38 - command:
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +020039 - sh
40 args:
41 - -c
jhh0ee08c02020-04-27 17:12:43 -050042 - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; chmod 0755 /config/${PFILE}; done"
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +020043 env:
44 - name: JDBC_USER
45 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
46 - name: JDBC_PASSWORD
47 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Dominik Mizynd1943c02020-04-16 10:41:01 +020048 - name: PDP_HTTP_USER_ID
49 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "login") | indent 10 }}
50 - name: PDP_HTTP_PASSWORD
51 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "password") | indent 10 }}
52 - name: PDP_PAP_PDP_HTTP_USER_ID
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "login") | indent 10 }}
54 - name: PDP_PAP_PDP_HTTP_PASSWORD
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "password") | indent 10 }}
56 - name: REPOSITORY_USERNAME
57 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nexus-creds" "key" "login") | indent 10 }}
58 - name: REPOSITORY_PASSWORD
59 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nexus-creds" "key" "password") | indent 10 }}
60 volumeMounts:
jhh0ee08c02020-04-27 17:12:43 -050061 - mountPath: /config-input/pe
62 name: pe-input
63 - mountPath: /config-input/pe-brmsgw
64 name: pe-brmsgw-input
65 - mountPath: /config/pe
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +020066 name: pe
jhh0ee08c02020-04-27 17:12:43 -050067 - mountPath: /config/pe-brmsgw
68 name: pe-brmsgw
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +020069 image: "{{ .Values.global.envsubstImage }}"
70 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71 name: {{ include "common.name" . }}-update-config
72 - command:
mayankg2703ced85142018-03-20 05:42:53 +000073 - /root/ready.py
74 args:
75 - --container-name
76 - {{ .Values.global.pap.nameOverride }}
77 env:
78 - name: NAMESPACE
79 valueFrom:
80 fieldRef:
81 apiVersion: v1
82 fieldPath: metadata.namespace
83 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
84 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85 name: {{ include "common.name" . }}-readiness
86 containers:
87 - command:
88 - /bin/bash
89 - ./do-start.sh
90 - brmsgw
91 name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000092 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mayankg2703ced85142018-03-20 05:42:53 +000093 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiak44088f92020-04-01 00:28:14 +020094 env:
95 - name: JDBC_USER
96 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
97 - name: JDBC_PASSWORD
98 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Dominik Mizynd1943c02020-04-16 10:41:01 +020099 - name: PDP_HTTP_USER_ID
100 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "login") | indent 10 }}
101 - name: PDP_HTTP_PASSWORD
102 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "password") | indent 10 }}
103 - name: PDP_PAP_PDP_HTTP_USER_ID
104 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "login") | indent 10 }}
105 - name: PDP_PAP_PDP_HTTP_PASSWORD
106 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "password") | indent 10 }}
107 - name: REPOSITORY_USERNAME
108 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nexus-creds" "key" "login") | indent 10 }}
109 - name: REPOSITORY_PASSWORD
110 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nexus-creds" "key" "password") | indent 10 }}
mayankg2703ced85142018-03-20 05:42:53 +0000111 ports:
112 - containerPort: {{ .Values.service.externalPort }}
113 {{- if eq .Values.liveness.enabled true }}
114 livenessProbe:
115 tcpSocket:
116 port: {{ .Values.service.externalPort }}
117 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
118 periodSeconds: {{ .Values.liveness.periodSeconds }}
119 {{- end }}
120 readinessProbe:
121 tcpSocket:
122 port: {{ .Values.service.externalPort }}
123 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
124 periodSeconds: {{ .Values.readiness.periodSeconds }}
125 volumeMounts:
126 - mountPath: /etc/localtime
127 name: localtime
128 readOnly: true
mayankg2703583b43e2018-04-17 05:10:56 +0000129 - mountPath: /tmp/policy-install/config/brmsgw-tweaks.sh
mayankg2703ced85142018-03-20 05:42:53 +0000130 name: pe-brmsgw
mayankg2703583b43e2018-04-17 05:10:56 +0000131 subPath: brmsgw-tweaks.sh
132 - mountPath: /tmp/policy-install/config/brmsgw.conf
133 name: pe-brmsgw
134 subPath: brmsgw.conf
mayankg2703ced85142018-03-20 05:42:53 +0000135 - mountPath: /tmp/policy-install/config/base.conf
jhh0ee08c02020-04-27 17:12:43 -0500136 name: pe
mayankg2703ced85142018-03-20 05:42:53 +0000137 subPath: base.conf
138 - mountPath: /tmp/policy-install/do-start.sh
139 name: pe-scripts
140 subPath: do-start.sh
141 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000142{{ include "common.resources" . | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +0000143 {{- if .Values.nodeSelector }}
144 nodeSelector:
145{{ toYaml .Values.nodeSelector | indent 10 }}
146 {{- end -}}
147 {{- if .Values.affinity }}
148 affinity:
149{{ toYaml .Values.affinity | indent 10 }}
150 {{- end }}
151 volumes:
152 - name: localtime
153 hostPath:
154 path: /etc/localtime
jhh0ee08c02020-04-27 17:12:43 -0500155 - name: pe-input
mayankg2703ced85142018-03-20 05:42:53 +0000156 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100157 name: {{ include "common.release" . }}-pe-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000158 defaultMode: 0755
159 - name: pe-scripts
160 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100161 name: {{ include "common.release" . }}-pe-scripts-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000162 defaultMode: 0777
jhh0ee08c02020-04-27 17:12:43 -0500163 - name: pe-brmsgw-input
mayankg2703ced85142018-03-20 05:42:53 +0000164 configMap:
165 name: {{ include "common.fullname" . }}-pe-configmap
166 defaultMode: 0755
jhh0ee08c02020-04-27 17:12:43 -0500167 - name: pe
168 emptyDir:
169 medium: Memory
170 - name: pe-brmsgw
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +0200171 emptyDir:
172 medium: Memory
mayankg2703ced85142018-03-20 05:42:53 +0000173 imagePullSecrets:
174 - name: "{{ include "common.namespace" . }}-docker-registry-key"