41560525e1ab6118867f86f28cc8b24ec04168a6
[oom.git] / kubernetes / sdc / templates / sdc-be.yaml
1 #{{ if not .Values.disableSdcSdcBe }}
2 apiVersion: extensions/v1beta1
3 kind: Deployment
4 metadata:
5   labels:
6     app: sdc-be
7   name: sdc-be
8   namespace: "{{ .Values.nsPrefix }}-sdc"
9 spec:
10   selector:
11     matchLabels:
12       app: sdc-be
13   template:
14     metadata:
15       labels:
16         app: sdc-be
17       name: sdc-be
18     spec:
19       initContainers:
20       - command:
21         - /root/ready.py
22         args:
23         - --container-name
24         - sdc-es
25         - --container-name
26         - sdc-cs
27         - --container-name
28         - sdc-kb
29         env:
30         - name: NAMESPACE
31           valueFrom:
32             fieldRef:
33               apiVersion: v1
34               fieldPath: metadata.namespace
35         image: {{ .Values.image.readiness }}
36         imagePullPolicy: {{ .Values.pullPolicy }}
37         name: sdc-be-readiness
38       - command:
39         - /root/ready.py
40         args:
41         - --container-name
42         - dmaap
43         env:
44         - name: NAMESPACE
45           value: {{ .Values.nsPrefix }}-message-router
46         image: {{ .Values.image.readiness }}
47         imagePullPolicy: {{ .Values.pullPolicy }}
48         name: sdc-dmaap-readiness
49       containers:
50       - env:
51         - name: ENVNAME
52           value: AUTO
53         - name: HOST_IP
54           valueFrom:
55             fieldRef:
56               fieldPath: status.podIP
57         image: {{ .Values.image.sdcBackend }}
58         imagePullPolicy: {{ .Values.pullPolicy }}
59         name: sdc-be
60         volumeMounts:
61         - mountPath: /usr/share/elasticsearch/data/
62           name: sdc-sdc-es-es
63         - mountPath: /root/chef-solo/environments/
64           name: sdc-environments
65         - mountPath: /etc/localtime
66           name: sdc-localtime
67           readOnly: true
68         - mountPath: /var/lib/jetty/logs
69           name: sdc-logs
70         - mountPath: /var/log/onap
71           name: sdc-logs-2
72         - mountPath: /tmp/logback.xml
73           name: sdc-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=/var/lib/jetty/config/catalog-be/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
78         ports:
79         - containerPort: 8443
80         - containerPort: 8080
81         readinessProbe:
82           tcpSocket:
83             port: 8443
84           initialDelaySeconds: 5
85           periodSeconds: 10
86       - image: {{ .Values.image.filebeat }}
87         imagePullPolicy: {{ .Values.pullPolicy }}
88         name: filebeat-onap
89         volumeMounts:
90         - mountPath: /usr/share/filebeat/filebeat.yml
91           name: filebeat-conf
92         - mountPath: /var/log/onap
93           name: sdc-logs-2
94         - mountPath: /usr/share/filebeat/data
95           name: sdc-data-filebeat
96       volumes:
97         - name: filebeat-conf
98           hostPath:
99             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
100         - name: sdc-logs-2
101           emptyDir: {}
102         - name: sdc-data-filebeat
103           emptyDir: {}
104         - name: sdc-logback
105           hostPath:
106             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/sdc/be/logback.xml
107         - name: sdc-sdc-es-es
108           hostPath:
109             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-es/ES
110         - name: sdc-environments
111           hostPath:
112             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/environments
113         - name: sdc-localtime
114           hostPath:
115             path:  /etc/localtime
116         - name:  sdc-logs
117           hostPath:
118             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/logs
119       imagePullSecrets:
120       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
121 #{{ end }}