blob: 0816aa52918f7251c50f41c2d5c2de07bf70d3bb [file] [log] [blame]
yurynfcef9942017-10-26 17:10:50 +03001#{{ if not .Values.disablePolicyPap }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -04002apiVersion: extensions/v1beta1
3kind: Deployment
4metadata:
5 name: pap
Mandeep Khinda0e8f8892017-08-25 03:31:17 +00006 namespace: "{{ .Values.nsPrefix }}-policy"
Mandeep Khindad6ea9872017-06-24 11:49:37 -04007spec:
8 selector:
9 matchLabels:
10 app: pap
11 template:
12 metadata:
13 labels:
14 app: pap
15 name: pap
16 annotations:
17 pod.beta.kubernetes.io/init-containers: '[
18 {
19 "args": [
20 "--container-name",
21 "nexus",
22 "--container-name",
23 "mariadb"
24 ],
25 "command": [
26 "/root/ready.py"
27 ],
28 "env": [
29 {
30 "name": "NAMESPACE",
31 "valueFrom": {
32 "fieldRef": {
33 "apiVersion": "v1",
34 "fieldPath": "metadata.namespace"
35 }
36 }
37 }
38 ],
Eric Aucdaafde2017-08-31 16:18:11 -040039 "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}",
kerenj3b697f62017-08-23 11:21:21 +000040 "imagePullPolicy": "{{ .Values.pullPolicy }}",
Mandeep Khindad6ea9872017-06-24 11:49:37 -040041 "name": "pap-readiness"
42 },
43 {
44 "env": [
45 {
46 "name": "POD_IP",
47 "valueFrom": {
48 "fieldRef": {
49 "apiVersion": "v1",
50 "fieldPath": "status.podIP"
51 }
52 }
53 }
54 ],
55 "command": ["/bin/bash", "-c", "echo $POD_IP > /config/ip_addr.txt"],
56 "volumeMounts": [
57 {
58 "mountPath": "/config/",
59 "name": "pe"
60 }
61 ],
kerenj3b697f62017-08-23 11:21:21 +000062 "image": "{{ .Values.image.ubuntu }}",
63 "imagePullPolicy": "{{ .Values.pullPolicy }}",
Mandeep Khindad6ea9872017-06-24 11:49:37 -040064 "name": "generate-ip-addr-txt"
65 }
66 ]'
67 spec:
68 containers:
69 - command:
70 - /bin/bash
71 - ./do-start.sh
72 - pap
Eric Aucdaafde2017-08-31 16:18:11 -040073 image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}"
kerenj3b697f62017-08-23 11:21:21 +000074 imagePullPolicy: {{ .Values.pullPolicy }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -040075 name: pap
76 ports:
77 - containerPort: 8443
78 - containerPort: 9091
79 readinessProbe:
80 tcpSocket:
81 port: 9091
82 initialDelaySeconds: 5
83 periodSeconds: 10
84 volumeMounts:
yuryn8b3bc5a2017-09-13 19:21:03 +030085 - mountPath: /etc/localtime
86 name: localtime
87 readOnly: true
Mandeep Khindad6ea9872017-06-24 11:49:37 -040088 - mountPath: /tmp/policy-install/config/
89 name: pe
yurynd0707be2017-09-27 14:54:18 +030090 - mountPath: /var/log/onap
91 name: policy-logs
92 - mountPath: /tmp/policy-install/logback.xml
93 name: policy-sdk-logback
94 - mountPath: /tmp/logback.xml
95 name: policy-logback
96 lifecycle:
97 postStart:
98 exec:
99 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"]
100 - image: {{ .Values.image.filebeat }}
101 imagePullPolicy: {{ .Values.pullPolicy }}
102 name: filebeat-onap
103 volumeMounts:
104 - mountPath: /usr/share/filebeat/filebeat.yml
105 name: filebeat-conf
106 - mountPath: /var/log/onap
107 name: policy-logs
108 - mountPath: /usr/share/filebeat/data
109 name: policy-data-filebeat
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400110 volumes:
yuryn8b3bc5a2017-09-13 19:21:03 +0300111 - name: localtime
112 hostPath:
113 path: /etc/localtime
yurynd0707be2017-09-27 14:54:18 +0300114 - name: filebeat-conf
115 hostPath:
116 path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
117 - name: policy-logs
118 emptyDir: {}
119 - name: policy-data-filebeat
120 emptyDir: {}
121 - name: policy-logback
122 hostPath:
123 path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/xacml-pap-rest/logback.xml
124 - name: policy-sdk-logback
125 hostPath:
126 path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/ep_sdk_app/logback.xml
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400127 - name: pe
128 hostPath:
Mandeep Khinda0e8f8892017-08-25 03:31:17 +0000129 path: /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/pe/
Borislav Glozman5197e2e2017-07-24 10:45:28 +0300130 imagePullSecrets:
Mandeep Khinda0e8f8892017-08-25 03:31:17 +0000131 - name: "{{ .Values.nsPrefix }}-docker-registry-key"
yurynfcef9942017-10-26 17:10:50 +0300132#{{ end }}