blob: 73493056b738ab6b13dc19f84138b7e3f8bff01e [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
42 - "cd /config-input && for PFILE in `ls -1 *.conf`; do envsubst <${PFILE} >/config/${PFILE}; done"
43 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 }}
48 volumeMounts:
49 - mountPath: /config-input
50 name: pe
51 - mountPath: /config
52 name: pe-processed
53 image: "{{ .Values.global.envsubstImage }}"
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 name: {{ include "common.name" . }}-update-config
56 - command:
mayankg2703ced85142018-03-20 05:42:53 +000057 - /root/ready.py
58 args:
59 - --container-name
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010060 - {{ include "common.release" . }}-galera-config
mayankg2703ced85142018-03-20 05:42:53 +000061 env:
62 - name: NAMESPACE
63 valueFrom:
64 fieldRef:
65 apiVersion: v1
66 fieldPath: metadata.namespace
67 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
68 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
69 name: {{ include "common.name" . }}-readiness
mayankg2703ced85142018-03-20 05:42:53 +000070 containers:
71 - command:
72 - /bin/bash
73 - ./do-start.sh
74 - pap
75 name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000076 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mayankg2703ced85142018-03-20 05:42:53 +000077 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
vaibhavjayas4136f5d2018-08-17 07:01:05 +000078 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000079{{ include "common.resources" . | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000080 ports:
81 - containerPort: {{ .Values.service.externalPort }}
82 - containerPort: {{ .Values.service.externalPort2 }}
83 {{- if eq .Values.liveness.enabled true }}
84 livenessProbe:
85 tcpSocket:
86 port: {{ .Values.service.externalPort }}
87 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
88 periodSeconds: {{ .Values.liveness.periodSeconds }}
89 {{ end -}}
90 readinessProbe:
91 tcpSocket:
92 port: {{ .Values.service.externalPort }}
93 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.readiness.periodSeconds }}
95 env:
96 - name: PRELOAD_POLICIES
97 value: "{{ .Values.config.preloadPolicies }}"
98 volumeMounts:
99 - mountPath: /etc/localtime
100 name: localtime
101 readOnly: true
mayankg2703583b43e2018-04-17 05:10:56 +0000102 - mountPath: /tmp/policy-install/config/pap-tweaks.sh
103 name: pe-pap
104 subPath: pap-tweaks.sh
105 - mountPath: /tmp/policy-install/config/paplp.conf
106 name: pe-pap
107 subPath: paplp.conf
108 - mountPath: /tmp/policy-install/config/pap.conf
109 name: pe-pap
110 subPath: pap.conf
111 - mountPath: /tmp/policy-install/config/mysql.conf
112 name: pe-pap
113 subPath: mysql.conf
114 - mountPath: /tmp/policy-install/config/elk.conf
115 name: pe-pap
116 subPath: elk.conf
117 - mountPath: /tmp/policy-install/config/console.conf
118 name: pe-pap
119 subPath: console.conf
mayankg2703ced85142018-03-20 05:42:53 +0000120 - mountPath: /tmp/policy-install/config/base.conf
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +0200121 name: pe-processed
mayankg2703ced85142018-03-20 05:42:53 +0000122 subPath: base.conf
mayankg2703ced85142018-03-20 05:42:53 +0000123 - mountPath: /tmp/policy-install/do-start.sh
124 name: pe-scripts
125 subPath: do-start.sh
126 - mountPath: /var/log/onap
127 name: policy-logs
128 - mountPath: /tmp/policy-install/logback.xml
129 name: policy-sdk-logback
130 subPath: logback.xml
131 - mountPath: /tmp/logback.xml
132 name: policy-logback
133 subPath: logback.xml
134 lifecycle:
135 postStart:
136 exec:
137 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/opt/app/policy/servers/pap/webapps/pap/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; export SRC=/tmp/policy-install/logback.xml; export DST=/opt/app/policy/servers/console/webapps/onap/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
138 - image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.global.loggingImage | default .Values.loggingImage }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +0000139 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
mayankg2703ced85142018-03-20 05:42:53 +0000140 name: filebeat-onap
141 volumeMounts:
142 - mountPath: /usr/share/filebeat/filebeat.yml
143 name: filebeat-conf
144 subPath: filebeat.yml
145 - mountPath: /var/log/onap
146 name: policy-logs
147 - mountPath: /usr/share/filebeat/data
148 name: policy-data-filebeat
mayankg2703ced85142018-03-20 05:42:53 +0000149 volumes:
150 - name: localtime
151 hostPath:
152 path: /etc/localtime
153 - name: filebeat-conf
154 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100155 name: {{ include "common.release" . }}-filebeat-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000156 - name: policy-logs
157 emptyDir: {}
158 - name: policy-data-filebeat
159 emptyDir: {}
160 - name: policy-logback
161 configMap:
162 name: {{ include "common.fullname" . }}-log-configmap
163 - name: policy-sdk-logback
164 configMap:
165 name: {{ include "common.fullname" . }}-sdk-log-configmap
166 - name: pe
167 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100168 name: {{ include "common.release" . }}-pe-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000169 defaultMode: 0755
170 - name: pe-scripts
171 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100172 name: {{ include "common.release" . }}-pe-scripts-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000173 defaultMode: 0777
174 - name: pe-pap
175 configMap:
176 name: {{ include "common.fullname" . }}-pe-configmap
177 defaultMode: 0755
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +0200178 - name: pe-processed
179 emptyDir:
180 medium: Memory
mayankg2703ced85142018-03-20 05:42:53 +0000181 imagePullSecrets:
182 - name: "{{ include "common.namespace" . }}-docker-registry-key"