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