Fix policy
[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       annotations:
18         pod.beta.kubernetes.io/init-containers: '[
19           {
20               "args": [
21                   "--container-name",
22                   "pap"
23               ],
24               "command": [
25                   "/root/ready.py"
26               ],
27               "env": [
28                   {
29                       "name": "NAMESPACE",
30                       "valueFrom": {
31                           "fieldRef": {
32                               "apiVersion": "v1",
33                               "fieldPath": "metadata.namespace"
34                           }
35                       }
36                   }
37               ],
38               "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}",
39               "imagePullPolicy": "{{ .Values.pullPolicy }}",
40               "name": "pdp-readiness"
41           }
42           ]'
43     spec:
44       containers:
45       - command:
46         - /bin/bash
47         - ./do-start.sh
48         - pdp
49         image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}"
50         imagePullPolicy: {{ .Values.pullPolicy }}
51         name: pdp
52         ports:
53         - containerPort: 8081
54         readinessProbe:
55           tcpSocket:
56             port: 8081
57           initialDelaySeconds: 5
58           periodSeconds: 10
59         volumeMounts:
60         - mountPath: /etc/localtime
61           name: localtime
62           readOnly: true
63         - mountPath: /tmp/policy-install/config
64           name: pe
65         - mountPath: /var/log/onap
66           name: policy-logs
67         - mountPath:  /tmp/logback.xml
68           name: policy-logback
69         lifecycle:
70           postStart:
71             exec:
72               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"]
73       - image: {{ .Values.image.filebeat }}
74         imagePullPolicy: {{ .Values.pullPolicy }}
75         name: filebeat-onap
76         volumeMounts:
77         - mountPath: /usr/share/filebeat/filebeat.yml
78           name: filebeat-conf
79         - mountPath: /var/log/onap
80           name: policy-logs
81         - mountPath: /usr/share/filebeat/data
82           name: policy-data-filebeat
83       volumes:
84         - name: localtime
85           hostPath:
86             path: /etc/localtime
87         - name: filebeat-conf
88           hostPath:
89             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
90         - name: policy-logs
91           emptyDir: {}
92         - name: policy-data-filebeat
93           emptyDir: {}
94         - name: policy-logback
95           hostPath:
96             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/xacml-pdp-rest/logback.xml
97         - name: pe
98           hostPath:
99             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/pe/
100       imagePullSecrets:
101       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
102 #{{ end }}