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