Merge "Exposed 8080 and 9090 ports in onap-cli"
[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         env:
27         - name: NAMESPACE
28           valueFrom:
29             fieldRef:
30               apiVersion: v1
31               fieldPath: metadata.namespace
32         image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}"
33         imagePullPolicy: {{ .Values.pullPolicy }}
34         name: drools-readiness
35       hostAliases:
36       - ip: "{{ .Values.aaiServiceClusterIp }}"
37         hostnames:
38         - "aai.api.simpledemo.openecomp.org"
39       containers:
40       - command:
41         - /bin/bash
42         - -c
43         - ./do-start.sh
44         image: "{{ .Values.image.policyDrools }}:{{ .Values.image.policyDroolsVersion }}"
45         imagePullPolicy: {{ .Values.pullPolicy }}
46         name: drools
47         ports:
48         - containerPort: 6969
49         readinessProbe:
50           tcpSocket:
51             port: 6969
52           initialDelaySeconds: 5
53           periodSeconds: 10
54         volumeMounts:
55         - mountPath: /etc/localtime
56           name: localtime
57           readOnly: true
58         - mountPath: /tmp/policy-install/config
59           name: drools
60         - mountPath: /usr/share/maven/conf/settings.xml
61           name: drools-settingsxml
62         - mountPath: /var/log/onap
63           name: policy-logs
64         - mountPath: /tmp/logback.xml
65           name: policy-logback
66         lifecycle:
67           postStart:
68             exec:
69               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"]
70       - image: {{ .Values.image.filebeat }}
71         imagePullPolicy: {{ .Values.pullPolicy }}
72         name: filebeat-onap
73         volumeMounts:
74         - mountPath: /usr/share/filebeat/filebeat.yml
75           name: filebeat-conf
76         - mountPath: /var/log/onap
77           name: policy-logs
78         - mountPath: /usr/share/filebeat/data
79           name: policy-data-filebeat
80       volumes:
81         - name: localtime
82           hostPath:
83             path: /etc/localtime
84         - name: filebeat-conf
85           hostPath:
86             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
87         - name: policy-logs
88           emptyDir: {}
89         - name: policy-data-filebeat
90           emptyDir: {}
91         - name: policy-logback
92           hostPath:
93             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/drools/logback.xml
94         - name: drools-settingsxml
95           hostPath:
96             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/drools/settings.xml
97         - name: drools
98           hostPath:
99             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/drools/
100       imagePullSecrets:
101       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
102 #{{ end }}