1558b65d18978fc03aec214e922a989294011001
[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       hostAliases:
47       - ip: "{{ .Values.aaiServiceClusterIp }}"
48         hostnames:
49         - "aai.api.simpledemo.openecomp.org"
50       containers:
51       - image: "{{ .Values.image.policyDrools }}:{{ .Values.image.policyDroolsVersion }}"
52         imagePullPolicy: {{ .Values.pullPolicy }}
53         name: drools
54         ports:
55         - containerPort: 6969
56         - containerPort: 9696
57         readinessProbe:
58           tcpSocket:
59             port: 6969
60           initialDelaySeconds: 5
61           periodSeconds: 10
62         volumeMounts:
63         - mountPath: /etc/localtime
64           name: localtime
65           readOnly: true
66         - mountPath: /tmp/policy-install/config
67           name: drools
68         - mountPath: /usr/share/maven/conf/settings.xml
69           name: drools-settingsxml
70         - mountPath: /var/log/onap
71           name: policy-logs
72         - mountPath: /tmp/logback.xml
73           name: policy-logback
74         lifecycle:
75           postStart:
76             exec:
77               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"]
78       - image: {{ .Values.image.filebeat }}
79         imagePullPolicy: {{ .Values.pullPolicy }}
80         name: filebeat-onap
81         volumeMounts:
82         - mountPath: /usr/share/filebeat/filebeat.yml
83           name: filebeat-conf
84         - mountPath: /var/log/onap
85           name: policy-logs
86         - mountPath: /usr/share/filebeat/data
87           name: policy-data-filebeat
88       volumes:
89         - name: localtime
90           hostPath:
91             path: /etc/localtime
92         - name: filebeat-conf
93           hostPath:
94             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
95         - name: policy-logs
96           emptyDir: {}
97         - name: policy-data-filebeat
98           emptyDir: {}
99         - name: policy-logback
100           hostPath:
101             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/drools/logback.xml
102         - name: drools-settingsxml
103           hostPath:
104             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/drools/settings.xml
105         - name: drools
106           hostPath:
107             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/drools/
108       imagePullSecrets:
109       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
110 #{{ end }}