Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / so / components / so-cnfm-lcm / templates / deployment.yaml
1 # Copyright © 2023 Nordix Foundation
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: {{- include "common.resourceMetadata" . | nindent 2 }}
18 spec:
19   selector: {{- include "common.selectors" . | nindent 4 }}
20   replicas: {{ index .Values.replicaCount }}
21   minReadySeconds: {{ index .Values.minReadySeconds }}
22   strategy:
23     type: {{ index .Values.updateStrategy.type }}
24     rollingUpdate:
25       maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }}
26       maxSurge: {{ index .Values.updateStrategy.maxSurge }}
27   template:
28     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
29     spec:
30       initContainers:
31         {{ include "common.readinessCheck.waitFor" . | indent 8 | trim }}
32       containers:
33         - name: {{ include "common.name" . }}
34           command: [ "./start-app.sh" ]
35           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
36           resources: {{ include "common.resources" . | nindent 12 }}
37           env:
38             - name: DB_HOST
39               value: {{ include "common.mariadbService" . }}
40             - name: DB_PORT
41               value: {{ include "common.mariadbPort" . | quote }}
42             - name: DB_USERNAME
43                 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }}
44             - name: DB_PASSWORD
45                 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }}
46             - name: DB_ADMIN_USERNAME
47                 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }}
48             - name: DB_ADMIN_PASSWORD
49                 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }}
50           envFrom:
51             - configMapRef:
52                 name: {{ include "common.fullname" . }}-configmap
53           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54           volumeMounts:
55             - name: logs
56               mountPath: /app/logs
57             - name: config
58               mountPath: /app/config
59               readOnly: true
60           livenessProbe:
61             tcpSocket:
62               port: {{ index .Values.livenessProbe.port }}
63             initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}}
64             periodSeconds: {{ index .Values.livenessProbe.periodSeconds}}
65             successThreshold: {{ index .Values.livenessProbe.successThreshold}}
66             failureThreshold: {{ index .Values.livenessProbe.failureThreshold}}
67           ports: {{ include "common.containerPorts" . | nindent 12  }}
68       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
69       volumes:
70         - name: logs
71           emptyDir: {}
72         - name: config
73           configMap:
74             name: {{ include "common.fullname" . }}-app-configmap
75       {{- include "common.imagePullSecrets" . | nindent 6 }}