[AAI] Reintegrate AAI OOM charts in main repo
[oom.git] / kubernetes / aai / components / aai-modelloader / templates / deployment.yaml
1 # Copyright © 2018 Amdocs, AT&T
2 # Modifications Copyright © 2018 Bell Canada
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: apps/v1
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   selector:
29     matchLabels:
30       app: {{ include "common.name" . }}
31   template:
32     metadata:
33       labels:
34         app: {{ include "common.name" . }}
35         release: {{ include "common.release" . }}
36       name: {{ include "common.name" . }}
37     spec:
38       {{- if .Values.nodeSelector }}
39       nodeSelector:
40 {{ toYaml .Values.nodeSelector | indent 8 }}
41       {{- end -}}
42       {{- if .Values.affinity }}
43       affinity:
44 {{ toYaml .Values.affinity | indent 8 }}
45       {{- end }}
46       containers:
47       - name: {{ include "common.name" . }}
48         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
49         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50         env:
51         - name: CONFIG_HOME
52           value: /opt/app/model-loader/config/
53         volumeMounts:
54         - mountPath: /etc/localtime
55           name: localtime
56           readOnly: true
57         - mountPath: /opt/app/model-loader/config/model-loader.properties
58           subPath: model-loader.properties
59           name: {{ include "common.fullname" . }}-prop-config
60         - mountPath: /opt/app/model-loader/config/auth/
61           name: {{ include "common.fullname" . }}-auth-config
62         - mountPath: /var/log/onap
63           name: {{ include "common.fullname" . }}-logs
64         - mountPath: /opt/app/model-loader/logback.xml
65           name: {{ include "common.fullname" . }}-log-conf
66           subPath: logback.xml
67         ports:
68         - containerPort: {{ .Values.service.internalPort }}
69         - containerPort: {{ .Values.service.internalPort2 }}
70         resources:
71 {{ include "common.resources" . }}
72
73       # side car containers
74       - name: filebeat-onap
75         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
76         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77         volumeMounts:
78         - mountPath: /usr/share/filebeat/filebeat.yml
79           subPath: filebeat.yml
80           name: filebeat-conf
81         - mountPath: /var/log/onap
82           name: {{ include "common.fullname" . }}-logs
83         - mountPath: /usr/share/filebeat/data
84           name: aai-filebeat
85         resources:
86 {{ include "common.resources" . }}
87       volumes:
88       - name: localtime
89         hostPath:
90           path: /etc/localtime
91       - name: {{ include "common.fullname" . }}-prop-config
92         configMap:
93           name: {{ include "common.fullname" . }}-prop
94       - name: {{ include "common.fullname" . }}-auth-config
95         secret:
96           secretName: {{ include "common.fullname" . }}
97       - name: filebeat-conf
98         configMap:
99           name: aai-filebeat
100       - name: {{ include "common.fullname" . }}-logs
101         emptyDir: {}
102       - name: aai-filebeat
103         emptyDir: {}
104       - name: {{ include "common.fullname" . }}-log-conf
105         configMap:
106          name: {{ include "common.fullname" . }}-log
107       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
108       imagePullSecrets:
109       - name: "{{ include "common.namespace" . }}-docker-registry-key"