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