blob: 16d5fb5cec2218736654372ef2ed47268d56a162 [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:
40 - /root/ready.py
41 args:
42 - --container-name
43 - {{ .Values.global.pap.nameOverride }}
44 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
50 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 name: {{ include "common.name" . }}-readiness
53 containers:
54 - command:
55 - /bin/bash
56 - ./do-start.sh
57 - pdp
58 name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000059 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mayankg2703ced85142018-03-20 05:42:53 +000060 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiake0784a92020-04-01 00:46:48 +020061 env:
62 - name: JDBC_USER
63 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
64 - name: JDBC_PASSWORD
65 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
vaibhavjayas4136f5d2018-08-17 07:01:05 +000066 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000067{{ include "common.resources" . | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000068 ports:
69 - containerPort: {{ .Values.service.externalPort }}
70 {{- if eq .Values.liveness.enabled true }}
71 livenessProbe:
72 tcpSocket:
73 port: {{ .Values.service.externalPort }}
74 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.liveness.periodSeconds }}
76 {{- end }}
77 readinessProbe:
78 tcpSocket:
79 port: {{ .Values.service.externalPort }}
80 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
81 periodSeconds: {{ .Values.readiness.periodSeconds }}
82 volumeMounts:
83 - mountPath: /etc/localtime
84 name: localtime
85 readOnly: true
86 - mountPath: /tmp/policy-install/config/base.conf
87 name: pe
88 subPath: base.conf
mayankg2703583b43e2018-04-17 05:10:56 +000089 - mountPath: /tmp/policy-install/config/pdp-tweaks.sh
mayankg2703ced85142018-03-20 05:42:53 +000090 name: pe-pdp
mayankg2703583b43e2018-04-17 05:10:56 +000091 subPath: pdp-tweaks.sh
92 - mountPath: /tmp/policy-install/config/pdplp.conf
93 name: pe-pdp
94 subPath: pdplp.conf
95 - mountPath: /tmp/policy-install/config/pdp.conf
96 name: pe-pdp
97 subPath: pdp.conf
mayankg2703ced85142018-03-20 05:42:53 +000098 - mountPath: /tmp/policy-install/do-start.sh
99 name: pe-scripts
100 subPath: do-start.sh
101 - mountPath: /var/log/onap
102 name: policy-logs
103 - mountPath: /tmp/logback.xml
104 name: policy-logback
105 subPath: logback.xml
106 lifecycle:
107 postStart:
108 exec:
109 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"]
110 - image: {{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}
111 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
112 name: filebeat-onap
113 volumeMounts:
114 - mountPath: /usr/share/filebeat/filebeat.yml
115 name: filebeat-conf
116 subPath: filebeat.yml
117 - mountPath: /var/log/onap
118 name: policy-logs
119 - mountPath: /usr/share/filebeat/data
120 name: policy-data-filebeat
mayankg2703ced85142018-03-20 05:42:53 +0000121 volumes:
122 - name: localtime
123 hostPath:
124 path: /etc/localtime
125 - name: filebeat-conf
126 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100127 name: {{ include "common.release" . }}-filebeat-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000128 - name: policy-logs
129 emptyDir: {}
130 - name: policy-data-filebeat
131 emptyDir: {}
132 - name: policy-logback
133 configMap:
134 name: {{ include "common.fullname" . }}-log-configmap
135 - name: pe
136 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100137 name: {{ include "common.release" . }}-pe-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000138 defaultMode: 0755
139 - name: pe-scripts
140 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100141 name: {{ include "common.release" . }}-pe-scripts-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000142 defaultMode: 0777
143 - name: pe-pdp
144 configMap:
145 name: {{ include "common.fullname" . }}-pe-configmap
146 defaultMode: 0755
147 imagePullSecrets:
148 - name: "{{ include "common.namespace" . }}-docker-registry-key"