blob: 8e0c40370dd4432e24fdee3413a0381978d8fc8e [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
16apiVersion: apps/v1beta1
17kind: StatefulSet
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:
Mahendra Raghuwanshic1395ec2018-04-26 03:19:03 +000027 serviceName: {{ include "common.servicename" . }}
mayankg2703ced85142018-03-20 05:42:53 +000028 replicas: {{ .Values.replicaCount }}
29 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
mayankg2703ced85142018-03-20 05:42:53 +000037 spec:
38 initContainers:
39 - command:
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +020040 - sh
41 args:
42 - -c
43 - "cd /config-input && for PFILE in `ls -1 *.conf`; do envsubst <${PFILE} >/config/${PFILE}; done"
44 env:
45 - name: JDBC_USER
46 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
47 - name: JDBC_PASSWORD
48 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Dominik Mizyn165a22d2020-04-16 11:21:23 +020049 - name: PDP_HTTP_USER_ID
50 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "login") | indent 10 }}
51 - name: PDP_HTTP_PASSWORD
52 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "password") | indent 10 }}
53 - name: PDP_PAP_PDP_HTTP_USER_ID
54 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "login") | indent 10 }}
55 - name: PDP_PAP_PDP_HTTP_PASSWORD
56 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "password") | indent 10 }}
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +020057 volumeMounts:
58 - mountPath: /config-input
59 name: pe
60 - mountPath: /config
61 name: pe-processed
62 image: "{{ .Values.global.envsubstImage }}"
63 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64 name: {{ include "common.name" . }}-update-config
65 - command:
mayankg2703ced85142018-03-20 05:42:53 +000066 - /root/ready.py
67 args:
68 - --container-name
69 - {{ .Values.global.pap.nameOverride }}
70 env:
71 - name: NAMESPACE
72 valueFrom:
73 fieldRef:
74 apiVersion: v1
75 fieldPath: metadata.namespace
76 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 name: {{ include "common.name" . }}-readiness
79 containers:
80 - command:
81 - /bin/bash
82 - ./do-start.sh
83 - pdp
84 name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000085 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mayankg2703ced85142018-03-20 05:42:53 +000086 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiake0784a92020-04-01 00:46:48 +020087 env:
88 - name: JDBC_USER
89 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
90 - name: JDBC_PASSWORD
91 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Dominik Mizyn165a22d2020-04-16 11:21:23 +020092 - name: PDP_HTTP_USER_ID
93 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "login") | indent 10 }}
94 - name: PDP_HTTP_PASSWORD
95 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pdp-http-creds" "key" "password") | indent 10 }}
96 - name: PDP_PAP_PDP_HTTP_USER_ID
97 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "login") | indent 10 }}
98 - name: PDP_PAP_PDP_HTTP_PASSWORD
99 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-http-creds" "key" "password") | indent 10 }}
vaibhavjayas4136f5d2018-08-17 07:01:05 +0000100 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000101{{ include "common.resources" . | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +0000102 ports:
103 - containerPort: {{ .Values.service.externalPort }}
104 {{- if eq .Values.liveness.enabled true }}
105 livenessProbe:
106 tcpSocket:
107 port: {{ .Values.service.externalPort }}
108 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
109 periodSeconds: {{ .Values.liveness.periodSeconds }}
110 {{- end }}
111 readinessProbe:
112 tcpSocket:
113 port: {{ .Values.service.externalPort }}
114 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
115 periodSeconds: {{ .Values.readiness.periodSeconds }}
116 volumeMounts:
117 - mountPath: /etc/localtime
118 name: localtime
119 readOnly: true
120 - 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
mayankg2703583b43e2018-04-17 05:10:56 +0000123 - mountPath: /tmp/policy-install/config/pdp-tweaks.sh
mayankg2703ced85142018-03-20 05:42:53 +0000124 name: pe-pdp
mayankg2703583b43e2018-04-17 05:10:56 +0000125 subPath: pdp-tweaks.sh
126 - mountPath: /tmp/policy-install/config/pdplp.conf
127 name: pe-pdp
128 subPath: pdplp.conf
129 - mountPath: /tmp/policy-install/config/pdp.conf
130 name: pe-pdp
131 subPath: pdp.conf
mayankg2703ced85142018-03-20 05:42:53 +0000132 - mountPath: /tmp/policy-install/do-start.sh
133 name: pe-scripts
134 subPath: do-start.sh
135 - mountPath: /var/log/onap
136 name: policy-logs
137 - mountPath: /tmp/logback.xml
138 name: policy-logback
139 subPath: logback.xml
140 lifecycle:
141 postStart:
142 exec:
143 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/opt/app/policy/servers/pdp/webapps/pdp/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"]
144 - image: {{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}
145 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
146 name: filebeat-onap
147 volumeMounts:
148 - mountPath: /usr/share/filebeat/filebeat.yml
149 name: filebeat-conf
150 subPath: filebeat.yml
151 - mountPath: /var/log/onap
152 name: policy-logs
153 - mountPath: /usr/share/filebeat/data
154 name: policy-data-filebeat
mayankg2703ced85142018-03-20 05:42:53 +0000155 volumes:
156 - name: localtime
157 hostPath:
158 path: /etc/localtime
159 - name: filebeat-conf
160 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100161 name: {{ include "common.release" . }}-filebeat-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000162 - name: policy-logs
163 emptyDir: {}
164 - name: policy-data-filebeat
165 emptyDir: {}
166 - name: policy-logback
167 configMap:
168 name: {{ include "common.fullname" . }}-log-configmap
169 - name: pe
170 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100171 name: {{ include "common.release" . }}-pe-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000172 defaultMode: 0755
173 - name: pe-scripts
174 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100175 name: {{ include "common.release" . }}-pe-scripts-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000176 defaultMode: 0777
177 - name: pe-pdp
178 configMap:
179 name: {{ include "common.fullname" . }}-pe-configmap
180 defaultMode: 0755
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +0200181 - name: pe-processed
182 emptyDir:
183 medium: Memory
mayankg2703ced85142018-03-20 05:42:53 +0000184 imagePullSecrets:
185 - name: "{{ include "common.namespace" . }}-docker-registry-key"