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