Merge "Helm Chart Standardization of uui"
[oom.git] / kubernetes / policy / templates / dep-drools.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 #{{ if not .Values.disablePolicyDrools }}
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: policy-drools
20   namespace: "{{ .Values.nsPrefix }}"
21 spec:
22   replicas: {{ .Values.droolsReplicas }}
23   selector:
24     matchLabels:
25       app: drools
26   template:
27     metadata:
28       labels:
29         app: drools
30       name: policy-drools
31     spec:
32       initContainers:
33       - command:
34         - /root/ready.py
35         args:
36         - --container-name
37         - mariadb
38         - --container-name
39         - nexus
40         env:
41         - name: NAMESPACE
42           valueFrom:
43             fieldRef:
44               apiVersion: v1
45               fieldPath: metadata.namespace
46         image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}"
47         imagePullPolicy: {{ .Values.pullPolicy }}
48         name: drools-readiness
49       hostAliases:
50       - ip: "{{ .Values.aaiServiceClusterIp }}"
51         hostnames:
52         - "aai.api.simpledemo.openecomp.org"
53       containers:
54       - command:
55         - /bin/bash
56         - -c
57         - ./do-start.sh
58         image: "{{ .Values.image.policyDrools }}:{{ .Values.image.policyDroolsVersion }}"
59         imagePullPolicy: {{ .Values.pullPolicy }}
60         name: drools
61         ports:
62         - containerPort: 6969
63         readinessProbe:
64           tcpSocket:
65             port: 6969
66           initialDelaySeconds: 5
67           periodSeconds: 10
68         volumeMounts:
69         - mountPath: /etc/localtime
70           name: localtime
71           readOnly: true
72         - mountPath: /tmp/policy-install/config/policy-keystore
73           name: drools-secret
74           subPath: policy-keystore
75         - mountPath: /tmp/policy-install/config/feature-healthcheck.conf
76           name: drools-secret
77           subPath: feature-healthcheck.conf
78         - mountPath: /tmp/policy-install/config/base.conf
79           name: drools-config
80           subPath: base.conf
81         - mountPath: /tmp/policy-install/config/policy-management.conf
82           name: drools-config
83           subPath: policy-management.conf
84         - mountPath: /tmp/policy-install/config/drools-tweaks.sh
85           name: drools-config
86           subPath: drools-tweaks.sh
87         - mountPath: /usr/share/maven/conf/settings.xml
88           name: drools-settingsxml
89           subPath: settings.xml
90         - mountPath: /var/log/onap
91           name: policy-logs
92         - mountPath: /tmp/logback.xml
93           name: policy-logback
94           subPath: logback.xml
95         lifecycle:
96           postStart:
97             exec:
98               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"]
99       - image: {{ .Values.image.filebeat }}
100         imagePullPolicy: {{ .Values.pullPolicy }}
101         name: filebeat-onap
102         volumeMounts:
103         - mountPath: /usr/share/filebeat/filebeat.yml
104           name: filebeat-conf
105           subPath: filebeat.yml
106         - mountPath: /var/log/onap
107           name: policy-logs
108         - mountPath: /usr/share/filebeat/data
109           name: policy-data-filebeat
110       volumes:
111         - name: localtime
112           hostPath:
113             path: /etc/localtime
114         - name: filebeat-conf
115           configMap:
116             name: policy-filebeat-configmap
117         - name: policy-logs
118           emptyDir: {}
119         - name: policy-data-filebeat
120           emptyDir: {}
121         - name: policy-logback
122           configMap:
123             name: policy-drools-log-configmap
124         - name: drools-settingsxml
125           configMap:
126             name: policy-dep-drools-settings-configmap
127         - name: drools-config
128           configMap:
129             name: policy-dep-drools-configmap
130             items:
131             - key: base.conf
132               path: base.conf
133               mode: 0755
134             - key: policy-management.conf
135               path: policy-management.conf
136               mode: 0755
137             - key: drools-tweaks.sh
138               path: drools-tweaks.sh
139               mode: 0755
140         - name: drools-secret
141           secret:
142             secretName: policy-dep-drools-secret
143             items:
144             - key: policy-keystore
145               path: policy-keystore
146               mode: 0644
147             - key: feature-healthcheck.conf
148               path: feature-healthcheck.conf
149               mode: 0644
150       imagePullSecrets:
151       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
152 #{{ end }}