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