Merge "vvp -- VNF Validation Platform"
[oom.git] / kubernetes / portal / charts / portal-app / templates / 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 apiVersion: extensions/v1beta1
16 kind: Deployment
17 metadata:
18   name: {{ include "common.fullname" . }}
19   namespace: {{ include "common.namespace" . }}
20   labels:
21     app: {{ include "common.name" . }}
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23     release: {{ .Release.Name }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ .Release.Name }}
32     spec:
33       initContainers:
34       - name: {{ include "common.name" . }}-job-completion
35         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
36         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
37         command:
38         - /root/job_complete.py
39         args:
40         - --job-name
41         - {{ .Release.Name }}-portal-db-config
42         env:
43         - name: NAMESPACE
44           valueFrom:
45             fieldRef:
46               apiVersion: v1
47               fieldPath: metadata.namespace
48       containers:
49       - name: {{ include "common.name" . }}
50         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52         command:
53           - /start-apache-tomcat.sh
54           - -i
55           - ""
56           - -n
57           - ""
58         env:
59           - name: CATALINA_OPTS
60             value: >
61               -Djavax.net.ssl.keyStore={{ .Values.global.env.tomcatDir }}/{{ .Values.global.truststoreFile}}
62               -Djavax.net.ssl.keyStorePassword={{ .Values.global.trustpass }}
63               -Djavax.net.ssl.trustStore={{ .Values.global.env.tomcatDir }}/{{ .Values.global.truststoreFile}}
64               -Djavax.net.ssl.trustStorePassword={{ .Values.global.trustpass }}
65           - name: javax.net.ssl.keyStore
66             value: {{ .Values.global.env.tomcatDir }}/{{ .Values.global.truststoreFile}} 
67           - name: javax.net.ssl.keyStorePassword
68             value: {{ .Values.global.trustpass }}
69           - name: javax.net.ssl.trustStore
70             value: {{ .Values.global.env.tomcatDir }}/{{ .Values.global.truststoreFile}}
71           - name: javax.net.ssl.trustStorePassword
72             value: {{ .Values.global.trustpass }}
73         ports:
74         - containerPort: {{ .Values.service.internalPort }}
75         - containerPort: {{ .Values.service.internalPort2 }}
76         - containerPort: {{ .Values.service.internalPort3 }}
77         - containerPort: {{ .Values.service.internalPort4 }}
78         {{- if eq .Values.liveness.enabled true }}
79         livenessProbe:
80           tcpSocket:
81             port: {{ .Values.service.internalPort }}
82           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
83           periodSeconds: {{ .Values.liveness.periodSeconds }}
84         {{ end -}}
85         readinessProbe:
86           tcpSocket:
87             port: {{ .Values.service.internalPort }}
88           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
89           periodSeconds: {{ .Values.readiness.periodSeconds }}
90         volumeMounts:
91         - mountPath: /etc/localtime
92           name: localtime
93           readOnly: true
94         - name: properties-onapportal
95           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTAL/WEB-INF/fusion/conf/fusion.properties"
96           subPath: fusion.properties
97         - name: properties-onapportal
98           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTAL/WEB-INF/classes/openid-connect.properties"
99           subPath: openid-connect.properties
100         - name: properties-onapportal
101           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTAL/WEB-INF/conf/system.properties"
102           subPath: system.properties
103         - name: properties-onapportal
104           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTAL/WEB-INF/classes/portal.properties"
105           subPath: portal.properties
106         - name: properties-onapportal
107           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTAL/WEB-INF/classes/music.properties"
108           subPath: music.properties
109         - name: properties-onapportal
110           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTAL/WEB-INF/classes/logback.xml"
111           subPath: logback.xml
112         - name: properties-onapportal
113           mountPath: "{{ .Values.global.env.tomcatDir }}/conf/server.xml"
114           subPath: server.xml
115         - name: authz-onapportal
116           mountPath: "{{ .Values.global.env.tomcatDir }}/{{ .Values.global.keystoreFile}}"
117           subPath: {{ .Values.global.keystoreFile}}
118         - name: authz-onapportal
119           mountPath: "{{ .Values.global.env.tomcatDir }}/{{ .Values.global.truststoreFile}}"
120           subPath: {{ .Values.global.truststoreFile}}          
121         - name: var-log-onap
122           mountPath: /var/log/onap
123         resources:
124 {{ include "common.resources" . | indent 12 }}
125       {{- if .Values.nodeSelector }}
126       nodeSelector:
127 {{ toYaml .Values.nodeSelector | indent 10 }}
128       {{- end -}}
129       {{- if .Values.affinity }}
130       affinity:
131 {{ toYaml .Values.affinity | indent 10 }}
132       {{- end }}
133       - name: filebeat-onap
134         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
135         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
136         volumeMounts:
137         - mountPath: /usr/share/filebeat/filebeat.yml
138           name: filebeat-conf
139           subPath: filebeat.yml
140         - name: portal-data-filebeat
141           mountPath: /usr/share/filebeat/data
142         - name: var-log-onap
143           mountPath: /var/log/onap
144       volumes:
145         - name: localtime
146           hostPath:
147             path: /etc/localtime
148         - name: properties-onapportal
149           configMap:
150             name: {{ include "common.fullname" . }}-onapportal
151             defaultMode: 0755
152         - name: authz-onapportal
153           secret:
154             secretName: {{ include "common.fullname" . }}-authz-onapportal
155         - name: filebeat-conf
156           configMap:
157             name: portal-filebeat
158         - name: var-log-onap
159           emptyDir: {}
160         - name: portal-data-filebeat
161           emptyDir: {}
162         - name: portal-tomcat-logs
163           emptyDir: {}
164       imagePullSecrets:
165       - name: "{{ include "common.namespace" . }}-docker-registry-key"