DNS add option for display target machine info
[oom.git] / kubernetes / portal / charts / portal-sdk / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 # Modifications Copyright © 2018 AT&T
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: {{ include "common.fullname" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ include "common.release" . }}
25     heritage: {{ .Release.Service }}
26 spec:
27   replicas: {{ .Values.replicaCount }}
28   template:
29     metadata:
30       labels:
31         app: {{ include "common.name" . }}
32         release: {{ include "common.release" . }}
33     spec:
34       initContainers:
35       - name: {{ include "common.name" . }}-readiness
36         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
37         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38         command:
39         - /root/ready.py
40         args:
41         - --container-name
42         - "portal-db"
43         env:
44         - name: NAMESPACE
45           valueFrom:
46             fieldRef:
47               apiVersion: v1
48               fieldPath: metadata.namespace
49       containers:
50       - name: {{ include "common.name" . }}
51         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
52         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53         command:
54           - /start-apache-tomcat.sh
55           - -b
56           - "{{ .Values.global.env.tomcatDir }}"
57         ports:
58         - containerPort: {{ .Values.service.internalPort }}
59         {{- if eq .Values.liveness.enabled true }}
60         livenessProbe:
61           tcpSocket:
62             port: {{ .Values.service.internalPort }}
63           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
64           periodSeconds: {{ .Values.liveness.periodSeconds }}
65         {{ end -}}
66         readinessProbe:
67           tcpSocket:
68             port: {{ .Values.service.internalPort }}
69           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
70           periodSeconds: {{ .Values.readiness.periodSeconds }}
71         volumeMounts:
72         - mountPath: /etc/localtime
73           name: localtime
74           readOnly: true
75         - name: properties-onapportalsdk
76           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTALSDK/WEB-INF/fusion/conf/fusion.properties"
77           subPath: fusion.properties
78         - name: properties-onapportalsdk
79           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTALSDK/WEB-INF/conf/system.properties"
80           subPath: system.properties
81         - name: properties-onapportalsdk
82           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTALSDK/WEB-INF/classes/portal.properties"
83           subPath: portal.properties
84         - name: properties-onapportalsdk
85           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTALSDK/WEB-INF/classes/music.properties"
86           subPath: music.properties
87         - name: properties-onapportalsdk
88           mountPath: "{{ .Values.global.env.tomcatDir }}/webapps/ONAPPORTALSDK/WEB-INF/classes/logback.xml"
89           subPath: logback.xml
90         - name: portal-tomcat-logs
91           mountPath: "{{ .Values.global.env.tomcatDir }}/logs"
92         - name: var-log-onap
93           mountPath: /var/log/onap
94         resources:
95 {{ include "common.resources" . | indent 12 }}
96       {{- if .Values.nodeSelector }}
97       nodeSelector:
98 {{ toYaml .Values.nodeSelector | indent 10 }}
99       {{- end -}}
100       {{- if .Values.affinity }}
101       affinity:
102 {{ toYaml .Values.affinity | indent 10 }}
103       {{- end }}
104       - name: filebeat-onap
105         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
106         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
107         volumeMounts:
108         - mountPath: /usr/share/filebeat/filebeat.yml
109           name: filebeat-conf
110           subPath: filebeat.yml
111         - name: portal-data-filebeat
112           mountPath: /usr/share/filebeat/data
113         - name: var-log-onap
114           mountPath: /var/log/onap
115       volumes:
116         - name: localtime
117           hostPath:
118             path: /etc/localtime
119         - name: properties-onapportalsdk
120           configMap:
121             name: {{ include "common.fullname" . }}-onapportalsdk
122             defaultMode: 0755
123         - name: filebeat-conf
124           configMap:
125             name: portal-filebeat
126         - name: var-log-onap
127           emptyDir: {}
128         - name: portal-data-filebeat
129           emptyDir: {}
130         - name: portal-tomcat-logs
131           emptyDir: {}
132       imagePullSecrets:
133       - name: "{{ include "common.namespace" . }}-docker-registry-key"