Config seg sdc deployment
[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           subPath: settings.xml
63         - mountPath: /var/log/onap
64           name: policy-logs
65         - mountPath: /tmp/logback.xml
66           name: policy-logback
67           subPath: logback.xml
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           subPath: filebeat.yml
79         - mountPath: /var/log/onap
80           name: policy-logs
81         - mountPath: /usr/share/filebeat/data
82           name: policy-data-filebeat
83       volumes:
84         - name: localtime
85           hostPath:
86             path: /etc/localtime
87         - name: filebeat-conf
88           configMap:
89             name: policy-filebeat-configmap
90         - name: policy-logs
91           emptyDir: {}
92         - name: policy-data-filebeat
93           emptyDir: {}
94         - name: policy-logback
95           configMap:
96             name: policy-drools-log-configmap
97         - name: drools-settingsxml
98           configMap:
99             name: policy-dep-drools-settings-configmap
100         - name: drools
101           secret:
102             secretName: policy-dep-drools-secret
103             items:
104             - key: policy-keystore
105               path: policy-keystore
106               mode: 0644
107             - key: feature-healthcheck.conf
108               path: feature-healthcheck.conf
109               mode: 0644
110             - key: base.conf
111               path: base.conf
112               mode: 0755
113             - key: policy-management.conf
114               path: policy-management.conf
115               mode: 0755
116             - key: drools-tweaks.sh
117               path: drools-tweaks.sh
118               mode: 0755
119       imagePullSecrets:
120       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
121 #{{ end }}