Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / aai / components / aai-modelloader / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 Amdocs, AT&T
3 # Modifications Copyright © 2018 Bell Canada
4 # Modifications Copyright © 2020-2021 Orange
5 # Modifications Copyright © 2023 Nordix Foundation
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #       http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 */}}
19
20 apiVersion: apps/v1
21 kind: Deployment
22 metadata:
23   name: {{ include "common.fullname" . }}
24   namespace: {{ include "common.namespace" . }}
25   labels:
26     app: {{ include "common.name" . }}
27     app.kubernetes.io/name: {{ include "common.name" . }}
28     {{- if .Chart.AppVersion }}
29     version: "{{ .Chart.AppVersion | replace "+" "_" }}"
30     {{- else }}
31     version: "{{ .Chart.Version | replace "+" "_" }}"
32     {{- end }}
33     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
34     release: {{ include "common.release" . }}
35     heritage: {{ .Release.Service }}
36 spec:
37   replicas: {{ .Values.replicaCount }}
38   strategy:
39     type: {{ .Values.updateStrategy.type }}
40     {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }}
41     rollingUpdate:
42       maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
43       maxSurge: {{ .Values.updateStrategy.maxSurge }}
44     {{- end }}
45   selector:
46     matchLabels:
47       app: {{ include "common.name" . }}
48   template:
49     metadata:
50       labels:
51         app: {{ include "common.name" . }}
52         release: {{ include "common.release" . }}
53         app.kubernetes.io/name: {{ include "common.name" . }}
54         {{- if .Chart.AppVersion }}
55         version: "{{ .Chart.AppVersion | replace "+" "_" }}"
56         {{- else }}
57         version: "{{ .Chart.Version | replace "+" "_" }}"
58         {{- end }}
59       name: {{ include "common.name" . }}
60     spec:
61       {{- if .Values.nodeSelector }}
62       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
63       {{- end -}}
64       {{- if .Values.affinity }}
65       affinity: {{ toYaml .Values.affinity | nindent 8 }}
66       {{- end }}
67       containers:
68       - name: {{ include "common.name" . }}
69         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
70         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71         env:
72         - name: CONFIG_HOME
73           value: /opt/app/model-loader/config/
74         - name: SASL_JAAS_CONFIG
75           valueFrom:
76             secretKeyRef:
77               name: {{ include "common.name" . }}-ku
78               key: sasl.jaas.config
79         volumeMounts:
80         - mountPath: /opt/app/model-loader/config/model-loader.properties
81           subPath: model-loader.properties
82           name: prop-config
83         - mountPath: /opt/app/model-loader/application.properties
84           subPath: application.properties
85           name: prop-config
86         - mountPath: {{ .Values.log.path }}
87           name: logs
88         - mountPath: /opt/app/model-loader/logback.xml
89           name: log-config
90           subPath: logback.xml
91         resources: {{ include "common.resources" . | nindent 10 }}
92       # side car containers
93         {{ include "common.log.sidecar" . | nindent 6 }}
94       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
95       volumes:
96       - name: prop-config
97         configMap:
98           name: {{ include "common.fullname" . }}-prop
99       - name: logs
100         emptyDir: {}
101       {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
102       - name: log-config
103         configMap:
104           name: {{ include "common.fullname" . }}-log
105       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
106       {{- include "common.imagePullSecrets" . | nindent 6 }}