blob: 5a0d0467ebfe3ad4d86cfef458d454ab4c16b7e4 [file] [log] [blame]
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00001# Copyright © 2017 Amdocs, Bell Canada
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
yurynfcef9942017-10-26 17:10:50 +030015#{{ if not .Values.disablePolicyPap }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -040016apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
BorislavG8bfc6cf2018-02-27 15:04:26 +000019 name: policy-pap
20 namespace: "{{ .Values.nsPrefix }}"
Mandeep Khindad6ea9872017-06-24 11:49:37 -040021spec:
vaibhav_16decf785cf32018-02-15 10:15:44 +000022 replicas: {{ .Values.papReplicas }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -040023 selector:
24 matchLabels:
25 app: pap
26 template:
27 metadata:
28 labels:
29 app: pap
BorislavG8bfc6cf2018-02-27 15:04:26 +000030 name: policy-pap
Mandeep Khindad6ea9872017-06-24 11:49:37 -040031 spec:
vasundhra86243b72017-11-22 11:56:23 +000032 initContainers:
33 - command:
34 - /root/ready.py
35 args:
36 - --container-name
vasundhra86243b72017-11-22 11:56:23 +000037 - mariadb
38 env:
39 - name: NAMESPACE
40 valueFrom:
41 fieldRef:
42 apiVersion: v1
43 fieldPath: metadata.namespace
44 image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}"
45 imagePullPolicy: {{ .Values.pullPolicy }}
46 name: pap-readiness
47 - command: ["/bin/bash", "-c", "echo $POD_IP > /config/ip_addr.txt"]
48 env:
49 - name: POD_IP
50 valueFrom:
51 fieldRef:
52 apiVersion: v1
53 fieldPath: status.podIP
54 volumeMounts:
55 - mountPath: /config/
56 name: pe
57 image: {{ .Values.image.ubuntu }}
58 imagePullPolicy: {{ .Values.pullPolicy }}
59 name: generate-ip-addr-txt
Mandeep Khindad6ea9872017-06-24 11:49:37 -040060 containers:
61 - command:
62 - /bin/bash
63 - ./do-start.sh
64 - pap
Eric Aucdaafde2017-08-31 16:18:11 -040065 image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}"
kerenj3b697f62017-08-23 11:21:21 +000066 imagePullPolicy: {{ .Values.pullPolicy }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -040067 name: pap
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -050068 env:
69 - name: PRELOAD_POLICIES
70 value: "true"
Mandeep Khindad6ea9872017-06-24 11:49:37 -040071 ports:
72 - containerPort: 8443
73 - containerPort: 9091
74 readinessProbe:
75 tcpSocket:
76 port: 9091
77 initialDelaySeconds: 5
78 periodSeconds: 10
79 volumeMounts:
yuryn8b3bc5a2017-09-13 19:21:03 +030080 - mountPath: /etc/localtime
81 name: localtime
82 readOnly: true
Mandeep Khindad6ea9872017-06-24 11:49:37 -040083 - mountPath: /tmp/policy-install/config/
84 name: pe
yurynd0707be2017-09-27 14:54:18 +030085 - mountPath: /var/log/onap
86 name: policy-logs
87 - mountPath: /tmp/policy-install/logback.xml
88 name: policy-sdk-logback
vaibhav_16dec8de39a72018-01-17 12:22:52 +000089 subPath: logback.xml
yurynd0707be2017-09-27 14:54:18 +030090 - mountPath: /tmp/logback.xml
91 name: policy-logback
vaibhav_16dec8de39a72018-01-17 12:22:52 +000092 subPath: logback.xml
yurynd0707be2017-09-27 14:54:18 +030093 lifecycle:
94 postStart:
95 exec:
96 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"]
97 - image: {{ .Values.image.filebeat }}
98 imagePullPolicy: {{ .Values.pullPolicy }}
99 name: filebeat-onap
100 volumeMounts:
101 - mountPath: /usr/share/filebeat/filebeat.yml
102 name: filebeat-conf
vaibhav_16dec8de39a72018-01-17 12:22:52 +0000103 subPath: filebeat.yml
yurynd0707be2017-09-27 14:54:18 +0300104 - mountPath: /var/log/onap
105 name: policy-logs
106 - mountPath: /usr/share/filebeat/data
107 name: policy-data-filebeat
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400108 volumes:
yuryn8b3bc5a2017-09-13 19:21:03 +0300109 - name: localtime
110 hostPath:
111 path: /etc/localtime
yurynd0707be2017-09-27 14:54:18 +0300112 - name: filebeat-conf
vaibhav_16dec8de39a72018-01-17 12:22:52 +0000113 configMap:
114 name: policy-filebeat-configmap
yurynd0707be2017-09-27 14:54:18 +0300115 - name: policy-logs
116 emptyDir: {}
117 - name: policy-data-filebeat
118 emptyDir: {}
119 - name: policy-logback
vaibhav_16dec8de39a72018-01-17 12:22:52 +0000120 configMap:
121 name: policy-pap-log-configmap
yurynd0707be2017-09-27 14:54:18 +0300122 - name: policy-sdk-logback
vaibhav_16dec8de39a72018-01-17 12:22:52 +0000123 configMap:
124 name: policy-sdk-log-configmap
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400125 - name: pe
vaibhav_16dec8de39a72018-01-17 12:22:52 +0000126 configMap:
127 name: policy-dep-pe-configmap
128 defaultMode: 0755
Borislav Glozman5197e2e2017-07-24 10:45:28 +0300129 imagePullSecrets:
Mandeep Khinda0e8f8892017-08-25 03:31:17 +0000130 - name: "{{ .Values.nsPrefix }}-docker-registry-key"
vasundhra86243b72017-11-22 11:56:23 +0000131#{{ end }}