Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / aai / components / aai-babel / 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: {{- include "common.resourceMetadata" . | nindent 2 }}
23 spec:
24   selector: {{- include "common.selectors" . | nindent 4 }}
25   replicas: {{ .Values.replicaCount }}
26   strategy:
27     type: {{ .Values.updateStrategy.type }}
28     {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }}
29     rollingUpdate:
30       maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
31       maxSurge: {{ .Values.updateStrategy.maxSurge }}
32     {{- end }}
33   template:
34     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
35     spec:
36       containers:
37         - name: {{ include "common.name" . }}
38           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
39           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40           ports: {{ include "common.containerPorts" . | nindent 12  }}
41           # disable liveness probe when breakpoints set in debugger
42           # so K8s doesn't restart unresponsive container
43           {{ if .Values.liveness.enabled }}
44           livenessProbe:
45             tcpSocket:
46               port: {{ .Values.service.internalPort }}
47             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
48             periodSeconds: {{ .Values.liveness.periodSeconds }}
49           {{ end }}
50           readinessProbe:
51             tcpSocket:
52               port: {{ .Values.service.internalPort }}
53             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
54             periodSeconds: {{ .Values.readiness.periodSeconds }}
55           env:
56             - name: KEY_STORE_PASSWORD
57               value: NotUsed
58             - name: CONFIG_HOME
59               value: /opt/app/babel/config
60           volumeMounts:
61           - mountPath: /opt/app/babel/config/application.properties
62             name: config
63             subPath: application.properties
64           - mountPath: /opt/app/babel/config/artifact-generator.properties
65             name: config
66             subPath: artifact-generator.properties
67           - mountPath: /opt/app/babel/config/tosca-mappings.json
68             name: config
69             subPath: tosca-mappings.json
70           - mountPath: /opt/app/babel/config/babel-auth.properties
71             name: config
72             subPath: babel-auth.properties
73           - mountPath: /opt/app/babel/config/auth
74             name: secrets
75           - mountPath: {{ .Values.log.path }}
76             name: logs
77           - mountPath: /opt/app/babel/config/logback.xml
78             name: config
79             subPath: logback.xml
80           resources: {{ include "common.resources" . | nindent 12 }}
81       {{- if .Values.nodeSelector }}
82       nodeSelector:
83 {{ toYaml .Values.nodeSelector | indent 8 }}
84       {{- end -}}
85       {{- if .Values.affinity }}
86       affinity:
87 {{ toYaml .Values.affinity | indent 8 }}
88       {{- end }}
89
90         # side car containers
91       {{ include "common.log.sidecar" . | nindent 8 }}
92       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
93       volumes:
94         - name: config
95           configMap:
96             name: {{ include "common.fullname" . }}-configmap
97         - name: secrets
98           secret:
99             secretName: {{ include "common.fullname" . }}-babel-secrets
100         - name: logs
101           emptyDir: {}
102         {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
103
104       {{- include "common.imagePullSecrets" . | nindent 6 }}