blob: b70b04b02388bc67cad7c21830ac0ff5b6e480ed [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
Krzysztof Opasiak6a9397d2020-04-24 00:14:26 +020043 - "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 +020044 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:
Krzysztof Opasiak6a9397d2020-04-24 00:14:26 +020058 - mountPath: /config-input/pe
59 name: pe-input
60 - mountPath: /config-input/pe-pdp
61 name: pe-pdp-input
62 - mountPath: /config/pe
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +020063 name: pe
Krzysztof Opasiak6a9397d2020-04-24 00:14:26 +020064 - mountPath: /config/pe-pdp
65 name: pe-pdp
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +020066 image: "{{ .Values.global.envsubstImage }}"
67 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
68 name: {{ include "common.name" . }}-update-config
69 - command:
mayankg2703ced85142018-03-20 05:42:53 +000070 - /root/ready.py
71 args:
72 - --container-name
73 - {{ .Values.global.pap.nameOverride }}
74 env:
75 - name: NAMESPACE
76 valueFrom:
77 fieldRef:
78 apiVersion: v1
79 fieldPath: metadata.namespace
80 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
81 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
82 name: {{ include "common.name" . }}-readiness
83 containers:
84 - command:
85 - /bin/bash
86 - ./do-start.sh
87 - pdp
88 name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000089 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mayankg2703ced85142018-03-20 05:42:53 +000090 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiake0784a92020-04-01 00:46:48 +020091 env:
92 - name: JDBC_USER
93 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
94 - name: JDBC_PASSWORD
95 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
vaibhavjayas4136f5d2018-08-17 07:01:05 +000096 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000097{{ include "common.resources" . | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000098 ports:
99 - containerPort: {{ .Values.service.externalPort }}
100 {{- if eq .Values.liveness.enabled true }}
101 livenessProbe:
102 tcpSocket:
103 port: {{ .Values.service.externalPort }}
104 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
105 periodSeconds: {{ .Values.liveness.periodSeconds }}
106 {{- end }}
107 readinessProbe:
108 tcpSocket:
109 port: {{ .Values.service.externalPort }}
110 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
111 periodSeconds: {{ .Values.readiness.periodSeconds }}
112 volumeMounts:
113 - mountPath: /etc/localtime
114 name: localtime
115 readOnly: true
116 - mountPath: /tmp/policy-install/config/base.conf
Krzysztof Opasiak6a9397d2020-04-24 00:14:26 +0200117 name: pe
mayankg2703ced85142018-03-20 05:42:53 +0000118 subPath: base.conf
mayankg2703583b43e2018-04-17 05:10:56 +0000119 - mountPath: /tmp/policy-install/config/pdp-tweaks.sh
Krzysztof Opasiak6a9397d2020-04-24 00:14:26 +0200120 name: pe-pdp-input
mayankg2703583b43e2018-04-17 05:10:56 +0000121 subPath: pdp-tweaks.sh
122 - mountPath: /tmp/policy-install/config/pdplp.conf
123 name: pe-pdp
124 subPath: pdplp.conf
125 - mountPath: /tmp/policy-install/config/pdp.conf
126 name: pe-pdp
127 subPath: pdp.conf
mayankg2703ced85142018-03-20 05:42:53 +0000128 - mountPath: /tmp/policy-install/do-start.sh
129 name: pe-scripts
130 subPath: do-start.sh
131 - mountPath: /var/log/onap
132 name: policy-logs
133 - mountPath: /tmp/logback.xml
134 name: policy-logback
135 subPath: logback.xml
136 lifecycle:
137 postStart:
138 exec:
139 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"]
140 - image: {{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}
141 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
142 name: filebeat-onap
143 volumeMounts:
144 - mountPath: /usr/share/filebeat/filebeat.yml
145 name: filebeat-conf
146 subPath: filebeat.yml
147 - mountPath: /var/log/onap
148 name: policy-logs
149 - mountPath: /usr/share/filebeat/data
150 name: policy-data-filebeat
mayankg2703ced85142018-03-20 05:42:53 +0000151 volumes:
152 - name: localtime
153 hostPath:
154 path: /etc/localtime
155 - name: filebeat-conf
156 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100157 name: {{ include "common.release" . }}-filebeat-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000158 - name: policy-logs
159 emptyDir: {}
160 - name: policy-data-filebeat
161 emptyDir: {}
162 - name: policy-logback
163 configMap:
164 name: {{ include "common.fullname" . }}-log-configmap
Krzysztof Opasiak6a9397d2020-04-24 00:14:26 +0200165 - name: pe-input
mayankg2703ced85142018-03-20 05:42:53 +0000166 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100167 name: {{ include "common.release" . }}-pe-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000168 defaultMode: 0755
169 - name: pe-scripts
170 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100171 name: {{ include "common.release" . }}-pe-scripts-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000172 defaultMode: 0777
Krzysztof Opasiak6a9397d2020-04-24 00:14:26 +0200173 - name: pe-pdp-input
mayankg2703ced85142018-03-20 05:42:53 +0000174 configMap:
175 name: {{ include "common.fullname" . }}-pe-configmap
176 defaultMode: 0755
Krzysztof Opasiak6a9397d2020-04-24 00:14:26 +0200177 - name: pe
178 emptyDir:
179 medium: Memory
180 - name: pe-pdp
Krzysztof Opasiak98a79cc2020-04-01 22:33:58 +0200181 emptyDir:
182 medium: Memory
mayankg2703ced85142018-03-20 05:42:53 +0000183 imagePullSecrets:
184 - name: "{{ include "common.namespace" . }}-docker-registry-key"