License addition in all yamls
[oom.git] / kubernetes / portal / templates / portal-apps-deployment.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.disablePortalPortalapps }}
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: portal-apps
20   namespace: "{{ .Values.nsPrefix }}"
21 spec:
22   replicas: {{ .Values.portalAppsReplicas }}
23   selector:
24     matchLabels:
25       app: portalapps
26   template:
27     metadata:
28        labels:
29          app: portalapps
30        name: portal-apps
31     spec:
32       initContainers:
33       - command:
34         - /root/ready.py
35         args:
36         - --container-name
37         - portaldb
38         env:
39         - name: NAMESPACE
40           valueFrom:
41             fieldRef:
42               apiVersion: v1
43               fieldPath: metadata.namespace
44         image: {{ .Values.image.readiness }}
45         imagePullPolicy: {{ .Values.pullPolicy }}
46         name: portalapps-readiness
47       - command: ["/bin/bash", "-c", "if [ ! -e /portal_root/boot.txt ]; then mysql -u root -pAa123456 -h portaldb < /portal-mysql/oom_updates.sql; fi"]
48         volumeMounts:
49         - mountPath: /portal-mysql/oom_updates.sql
50           name: portal-mariadb-onboarding-sql
51           subPath: oom_updates.sql
52         - mountPath: /portal_root/
53           name: portal-root
54         image: {{ .Values.image.mariadbClient }}
55         imagePullPolicy: {{ .Values.pullPolicy }}
56         name: provision-portaldb-users
57       - command: ["/bin/bash", "-c", "mkdir -p /ubuntu-init/ && chmod -R 777 /ubuntu-init/"]
58         volumeMounts:
59         - name: portal-logs
60           mountPath: /ubuntu-init/
61         image: {{ .Values.image.ubuntuInit }}
62         imagePullPolicy: {{ .Values.pullPolicy }}
63         name: portal-app-logs-init
64       containers:
65       - image: {{ .Values.image.portalapps }}
66         imagePullPolicy: {{ .Values.pullPolicy }}
67         lifecycle:
68           postStart:
69             exec:
70               command: ["/bin/sh", "-c", "echo yes > /portal_root/boot.txt"]
71         name: portalapps
72         volumeMounts:
73         - mountPath: /etc/localtime
74           name: localtime
75           readOnly: true
76         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/fusion/conf/fusion.properties"
77           name: onap-portal-properties
78           subPath: fusion.properties
79         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/classes/openid-connect.properties"
80           name: onap-portal-properties
81           subPath: openid-connect.properties
82         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/conf/system.properties"
83           name: onap-portal-properties
84           subPath: system.properties
85         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/classes/portal.properties"
86           name: onap-portal-properties
87           subPath: portal.properties
88         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/classes/logback.xml"
89           name: portal-logback
90           subPath: logback.xml
91         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTALSDK/WEB-INF/conf/system.properties"
92           name: portal-sdkapp-properties
93           subPath: system.properties
94         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTALSDK/WEB-INF/classes/portal.properties"
95           name: portal-sdkapp-properties
96           subPath: portal.properties
97         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTALSDK/WEB-INF/fusion/conf/fusion.properties"
98           name: portal-sdkapp-properties
99           subPath: fusion.properties
100         - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTALSDK/WEB-INF/classes/logback.xml"
101           name: sdkapp-logback
102           subPath: logback.xml
103         - mountPath: /portal_root/
104           name: portal-root
105         - mountPath: "{{ .Values.onapPortal.webappsDir }}/logs"
106           name: portal-logs
107         - mountPath: /var/log/onap
108           name: portal-logs2
109         ports:
110         - containerPort: 8005
111         - containerPort: 8009
112         - containerPort: 8080
113         readinessProbe:
114           tcpSocket:
115             port: 8080
116           initialDelaySeconds: 5
117           periodSeconds: 10
118       - image: {{ .Values.image.filebeat }}
119         imagePullPolicy: {{ .Values.pullPolicy }}
120         name: filebeat-onap
121         volumeMounts:
122         - mountPath: /usr/share/filebeat/filebeat.yml
123           name: filebeat-conf
124           subPath: filebeat.yml
125         - mountPath: /var/log/onap
126           name: portal-logs2
127         - mountPath: /usr/share/filebeat/data
128           name: portal-data-filebeat
129       volumes:
130         - name: localtime
131           hostPath:
132             path: /etc/localtime
133         - name: filebeat-conf
134           configMap:
135             name: portal-filebeat-configmap
136         - name: portal-logs2
137           emptyDir: {}
138         - name: portal-data-filebeat
139           emptyDir: {}
140         - name: onap-portal-properties
141           configMap:
142             defaultMode: 0755
143             name: portal-onap-portal-configmap
144         - name: portal-sdkapp-properties
145           configMap:
146             defaultMode: 0755
147             name: portal-onap-portal-sdk-configmap
148         - name: portal-logback
149           configMap:
150             name: portal-onapportal-log-configmap
151         - name: sdkapp-logback
152           configMap:
153             name: portal-onapportalsdk-log-configmap
154         - name: portal-mariadb-onboarding-sql
155           configMap:
156             name: portal-mariadb-configmap
157         - name: portal-root
158           hostPath:
159             path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/portal
160         - name: portal-logs
161           hostPath:
162             path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/portal/logs
163       imagePullSecrets:
164       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
165 #{{ end }}