Merge "Update annotations to spec for clamp"
[oom.git] / kubernetes / policy / templates / dep-pdp.yaml
1 #{{ if not .Values.disablePolicyPdp }}
2 apiVersion: extensions/v1beta1
3 kind: Deployment
4 metadata:
5   name: pdp
6   namespace: "{{ .Values.nsPrefix }}-policy"
7 spec:
8   replicas: 1
9   selector:
10     matchLabels:
11       app: pdp
12   template:
13     metadata:
14       labels:
15         app: pdp
16       name: pdp
17     spec:
18       initContainers:
19       - command:
20         - /root/ready.py
21         args:
22         - --container-name
23         - mariadb
24         - --container-name
25         - nexus
26         - --container-name
27         - pap
28         env:
29         - name: NAMESPACE
30           valueFrom:
31             fieldRef:
32               apiVersion: v1
33               fieldPath: metadata.namespace
34         image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}"
35         imagePullPolicy: {{ .Values.pullPolicy }}
36         name: pdp-readiness
37       containers:
38       - command:
39         - /bin/bash
40         - ./do-start.sh
41         - pdp
42         image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}"
43         imagePullPolicy: {{ .Values.pullPolicy }}
44         name: pdp
45         ports:
46         - containerPort: 8081
47         readinessProbe:
48           tcpSocket:
49             port: 8081
50           initialDelaySeconds: 5
51           periodSeconds: 10
52         volumeMounts:
53         - mountPath: /etc/localtime
54           name: localtime
55           readOnly: true
56         - mountPath: /tmp/policy-install/config
57           name: pe
58         - mountPath: /var/log/onap
59           name: policy-logs
60         - mountPath:  /tmp/logback.xml
61           name: policy-logback
62         lifecycle:
63           postStart:
64             exec:
65               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"]
66       - image: {{ .Values.image.filebeat }}
67         imagePullPolicy: {{ .Values.pullPolicy }}
68         name: filebeat-onap
69         volumeMounts:
70         - mountPath: /usr/share/filebeat/filebeat.yml
71           name: filebeat-conf
72         - mountPath: /var/log/onap
73           name: policy-logs
74         - mountPath: /usr/share/filebeat/data
75           name: policy-data-filebeat
76       volumes:
77         - name: localtime
78           hostPath:
79             path: /etc/localtime
80         - name: filebeat-conf
81           hostPath:
82             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
83         - name: policy-logs
84           emptyDir: {}
85         - name: policy-data-filebeat
86           emptyDir: {}
87         - name: policy-logback
88           hostPath:
89             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/xacml-pdp-rest/logback.xml
90         - name: pe
91           hostPath:
92             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/pe/
93       imagePullSecrets:
94       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
95 #{{ end }}