blob: 3110802fa008bddfc6a0a0935d363d596f5fc9d6 [file] [log] [blame]
Jakub Latusek44f0fdd2020-10-21 13:36:29 +02001{{/*
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +00002# Copyright © 2018 AT&T USA
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00003#
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.
Jakub Latusek44f0fdd2020-10-21 13:36:29 +020015*/}}
Grzegorz-Lisd1c1f6a2020-07-29 12:22:40 +020016apiVersion: apps/v1
Mike Elliottd32d36e2018-02-12 15:54:03 -050017kind: Deployment
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010018metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Mike Elliottd32d36e2018-02-12 15:54:03 -050019spec:
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010020 selector: {{- include "common.selectors" . | nindent 4 }}
21 replicas: {{ .Values.replicaCount }}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000022 minReadySeconds: {{ index .Values.minReadySeconds }}
23 strategy:
24 type: {{ index .Values.updateStrategy.type }}
25 rollingUpdate:
26 maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }}
27 maxSurge: {{ index .Values.updateStrategy.maxSurge }}
Mike Elliottd32d36e2018-02-12 15:54:03 -050028 template:
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010029 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Mike Elliottd32d36e2018-02-12 15:54:03 -050030 spec:
seshukm0df1f8e2020-08-17 21:45:49 +053031 initContainers:
Sylvain Desbureauxd055a172020-10-30 14:32:03 +010032 {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
Mike Elliottd32d36e2018-02-12 15:54:03 -050033 containers:
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000034 - name: {{ include "common.name" . }}
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010035 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010036 resources: {{ include "common.resources" . | nindent 10 }}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000037 env:
38 - name: DB_HOST
krishnaa9692b606b2020-10-30 11:29:21 +053039 value: {{ include "common.mariadbService" . }}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000040 - name: DB_PORT
krishnaa9692b606b2020-10-30 11:29:21 +053041 value: {{ include "common.mariadbPort" . | quote }}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000042 - name: DB_USERNAME
Krzysztof Opasiakc53ff542020-03-28 02:14:37 +010043 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000044 - name: DB_PASSWORD
Krzysztof Opasiakc53ff542020-03-28 02:14:37 +010045 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000046 - name: DB_ADMIN_USERNAME
Krzysztof Opasiakc53ff542020-03-28 02:14:37 +010047 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 10 }}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000048 - name: DB_ADMIN_PASSWORD
Krzysztof Opasiakc53ff542020-03-28 02:14:37 +010049 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 10 }}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000050 envFrom:
51 - configMapRef:
52 name: {{ include "common.fullname" . }}-configmap
jmacc4f04d32018-10-12 18:24:24 +000053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010054 volumeMounts:
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000055 - name: logs
56 mountPath: /app/logs
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000057 - name: config
58 mountPath: /app/config
59 readOnly: true
sunilb0a97ab22020-02-25 10:18:48 +053060 - name: {{ include "common.fullname" . }}-logs
Maciej Wereskidf9ba222021-11-05 14:38:18 +000061 mountPath: {{ .Values.log.path }}
seshukm0df1f8e2020-08-17 21:45:49 +053062{{ include "so.helpers.livenessProbe" .| indent 8 }}
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010063 ports: {{ include "common.containerPorts" . | nindent 10 }}
sunilb0a97ab22020-02-25 10:18:48 +053064 # Filebeat sidecar container
Maciej Wereskidf9ba222021-11-05 14:38:18 +000065 {{ include "common.log.sidecar" . | nindent 6 }}
farida azmy87f46222021-04-06 15:25:15 +020066 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010067 volumes:
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000068 - name: logs
69 emptyDir: {}
Ramesh Parthasarathy3cd3fb12018-09-05 01:47:29 +000070 - name: config
71 configMap:
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010072 name: {{ include "common.fullname" . }}-app-configmap
sunilb0a97ab22020-02-25 10:18:48 +053073 - name: {{ include "common.fullname" . }}-log-conf
74 configMap:
75 name: {{ include "common.fullname" . }}-log
Maciej Wereskidf9ba222021-11-05 14:38:18 +000076 {{ include "common.log.volumes" . | nindent 6 }}
sunilb0a97ab22020-02-25 10:18:48 +053077 - name: {{ include "common.fullname" . }}-logs
78 emptyDir: {}
Mike Elliottd32d36e2018-02-12 15:54:03 -050079 imagePullSecrets:
vaibhav16dec0da88292018-08-13 06:10:27 +000080 - name: "{{ include "common.namespace" . }}-docker-registry-key"