Merge "Update annotations to spec for sdc"
[oom.git] / kubernetes / policy / templates / dep-drools.yaml
1 #{{ if not .Values.disablePolicyDrools }}
2 apiVersion: extensions/v1beta1
3 kind: Deployment
4 metadata:
5   name: drools
6   namespace: "{{ .Values.nsPrefix }}-policy"
7 spec:
8   replicas: 1
9   selector:
10     matchLabels:
11       app: drools
12   template:
13     metadata:
14       labels:
15         app: drools
16       name: drools
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         - --container-name
29         - pdp
30         - --container-name
31         - brmsgw
32         env:
33         - name: NAMESPACE
34           valueFrom:
35             fieldRef:
36               apiVersion: v1
37               fieldPath: metadata.namespace
38         image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}"
39         imagePullPolicy: {{ .Values.pullPolicy }}
40         name: drools-readiness
41       containers:
42       - command:
43         - /bin/bash
44         - -c
45         - ./do-start.sh
46         image: "{{ .Values.image.policyDrools }}:{{ .Values.image.policyDroolsVersion }}"
47         imagePullPolicy: {{ .Values.pullPolicy }}
48         name: drools
49         ports:
50         - containerPort: 6969
51         readinessProbe:
52           tcpSocket:
53             port: 6969
54           initialDelaySeconds: 5
55           periodSeconds: 10
56         volumeMounts:
57         - mountPath: /etc/localtime
58           name: localtime
59           readOnly: true
60         - mountPath: /tmp/policy-install/config
61           name: drools
62         - mountPath: /usr/share/maven/conf/settings.xml
63           name: drools-settingsxml
64         - mountPath: /var/log/onap
65           name: policy-logs
66         - mountPath: /tmp/logback.xml
67           name: policy-logback
68         lifecycle:
69           postStart:
70             exec:
71               command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/opt/app/policy/config/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
72       - image: {{ .Values.image.filebeat }}
73         imagePullPolicy: {{ .Values.pullPolicy }}
74         name: filebeat-onap
75         volumeMounts:
76         - mountPath: /usr/share/filebeat/filebeat.yml
77           name: filebeat-conf
78         - mountPath: /var/log/onap
79           name: policy-logs
80         - mountPath: /usr/share/filebeat/data
81           name: policy-data-filebeat
82       volumes:
83         - name: localtime
84           hostPath:
85             path: /etc/localtime
86         - name: filebeat-conf
87           hostPath:
88             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
89         - name: policy-logs
90           emptyDir: {}
91         - name: policy-data-filebeat
92           emptyDir: {}
93         - name: policy-logback
94           hostPath:
95             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/drools/logback.xml
96         - name: drools-settingsxml
97           hostPath:
98             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/drools/settings.xml
99         - name: drools
100           hostPath:
101             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/drools/
102       imagePullSecrets:
103       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
104 #{{ end }}