License addition in all yamls
[oom.git] / kubernetes / sdc / templates / sdc-fe.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.disableSdcSdcFe }}
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   labels:
20     app: sdc-fe
21   name: sdc-fe
22   namespace: "{{ .Values.nsPrefix }}"
23 spec:
24   selector:
25     matchLabels:
26       app: sdc-fe
27   template:
28     metadata:
29       labels:
30         app: sdc-fe
31       name: sdc-fe
32     spec:
33       initContainers:
34       - command:
35         - /root/ready.py
36         args:
37         - --container-name
38         - sdc-es
39         - --container-name
40         - sdc-cs
41         - --container-name
42         - sdc-kb
43         - --container-name
44         - sdc-be
45         env:
46         - name: NAMESPACE
47           valueFrom:
48             fieldRef:
49               apiVersion: v1
50               fieldPath: metadata.namespace
51         image: {{ .Values.image.readiness }}
52         imagePullPolicy: {{ .Values.pullPolicy }}
53         name: sdc-fe-readiness
54       containers:
55       - name: sdc-fe
56         env:
57         - name: ENVNAME
58           value: AUTO
59         - name: HOST_IP
60           valueFrom:
61             fieldRef:
62               fieldPath: status.podIP
63         image: {{ .Values.image.sdcFrontend }}
64         imagePullPolicy: {{ .Values.pullPolicy }}
65         volumeMounts:
66         - mountPath: /usr/share/elasticsearch/data/
67           name: sdc-sdc-es-es
68         - mountPath: /root/chef-solo/environments/
69           name: sdc-environments
70         - mountPath: /etc/localtime
71           name: sdc-localtime
72           readOnly: true
73         - mountPath: /var/lib/jetty/logs
74           name: sdc-logs
75         - mountPath: /var/log/onap
76           name: sdc-logs-2
77         - mountPath: /root/chef-solo/cookbooks/sdc-catalog-fe/recipes/FE_2_setup_configuration.rb
78           name: sdc-fe-config
79           subPath: FE_2_setup_configuration.rb
80         - mountPath: /tmp/logback.xml
81           name: sdc-logback
82         lifecycle:
83           postStart:
84             exec:
85               command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/catalog-fe/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
86         ports:
87         - containerPort: 9443
88         - containerPort: 8181
89         readinessProbe:
90           tcpSocket:
91             port: 8181
92           initialDelaySeconds: 5
93           periodSeconds: 10
94       - image: {{ .Values.image.filebeat }}
95         imagePullPolicy: {{ .Values.pullPolicy }}
96         name: filebeat-onap
97         volumeMounts:
98         - mountPath: /usr/share/filebeat/filebeat.yml
99           name: filebeat-conf
100           subPath: filebeat.yml
101         - mountPath: /var/log/onap
102           name: sdc-logs-2
103         - mountPath: /usr/share/filebeat/data
104           name: sdc-data-filebeat
105       volumes:
106         - name: filebeat-conf
107           configMap:
108            name : sdc-filebeat-configmap
109         - name: sdc-logs-2
110           emptyDir: {}
111         - name: sdc-data-filebeat
112           emptyDir: {}
113         - name: sdc-logback
114           configMap:
115            name : sdc-log-fe-configmap
116         - name: sdc-sdc-es-es
117           hostPath:
118             path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/sdc/sdc-es/ES
119         - name: sdc-environments
120           configMap:
121             name: sdc-environments-configmap
122             defaultMode: 0755
123         - name: sdc-localtime
124           hostPath:
125             path:  /etc/localtime
126         - name:  sdc-logs
127           hostPath:
128             path:  {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/sdc/logs
129         - name:  sdc-fe-config
130           configMap:
131             name: sdc-fe-configmap
132             defaultMode: 0755
133       imagePullSecrets:
134       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
135 #{{ end }}