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