License addition in all yamls
[oom.git] / kubernetes / policy / templates / dep-pap.yaml
1 # 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
15 #{{ if not .Values.disablePolicyPap }}
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: policy-pap
20   namespace: "{{ .Values.nsPrefix }}"
21 spec:
22   replicas: {{ .Values.papReplicas }}
23   selector:
24     matchLabels:
25       app: pap
26   template:
27     metadata:
28       labels:
29         app: pap
30       name: policy-pap
31     spec:
32       initContainers:
33       - command:
34         - /root/ready.py
35         args:
36         - --container-name
37         - 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
60       containers:
61       - command:
62         - /bin/bash
63         - ./do-start.sh
64         - pap
65         image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}"
66         imagePullPolicy: {{ .Values.pullPolicy }}
67         name: pap
68         env:
69         - name: PRELOAD_POLICIES
70           value: "true"
71         ports:
72         - containerPort: 8443
73         - containerPort: 9091
74         readinessProbe:
75           tcpSocket:
76             port: 9091
77           initialDelaySeconds: 5
78           periodSeconds: 10
79         volumeMounts:
80         - mountPath: /etc/localtime
81           name: localtime
82           readOnly: true
83         - mountPath: /tmp/policy-install/config/
84           name: pe
85         - mountPath: /var/log/onap
86           name: policy-logs
87         - mountPath: /tmp/policy-install/logback.xml
88           name: policy-sdk-logback
89           subPath: logback.xml
90         - mountPath: /tmp/logback.xml
91           name: policy-logback
92           subPath: logback.xml
93         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
103           subPath: filebeat.yml
104         - mountPath: /var/log/onap
105           name: policy-logs
106         - mountPath: /usr/share/filebeat/data
107           name: policy-data-filebeat
108       volumes:
109         - name: localtime
110           hostPath:
111             path: /etc/localtime
112         - name: filebeat-conf
113           configMap:
114             name: policy-filebeat-configmap
115         - name: policy-logs
116           emptyDir: {}
117         - name: policy-data-filebeat
118           emptyDir: {}
119         - name: policy-logback
120           configMap:
121             name: policy-pap-log-configmap
122         - name: policy-sdk-logback
123           configMap:
124             name: policy-sdk-log-configmap
125         - name: pe
126           configMap:
127             name: policy-dep-pe-configmap
128             defaultMode: 0755
129       imagePullSecrets:
130       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
131 #{{ end }}