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