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