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