blob: 397e8fd5565f104e9c66e0c34acc95f9e476d4ee [file] [log] [blame]
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +01001{{/*
Sylvain Desbureaux70070412020-11-09 21:58:48 +01002# Copyright © 2018 Amdocs, AT&T
3# Modifications Copyright © 2018 Bell Canada
Sylvain Desbureaux6212bb22021-01-18 11:43:33 +01004# Modifications Copyright © 2020,2021 Orange
efiacord12c1672023-03-23 12:10:50 +00005# Modifications Copyright © 2023 Nordix Foundation
Sylvain Desbureaux70070412020-11-09 21:58:48 +01006#
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.
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010018*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010019
20apiVersion: apps/v1
21kind: Deployment
Andreas Geissler5846a6e2023-03-30 17:26:14 +020022metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010023spec:
Andreas Geissler5846a6e2023-03-30 17:26:14 +020024 selector: {{- include "common.selectors" . | nindent 4 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010025 replicas: {{ .Values.replicaCount }}
Rommel Pawar63db7162022-11-16 10:11:24 -080026 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 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010033 template:
Andreas Geissler5846a6e2023-03-30 17:26:14 +020034 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010035 spec:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010036 containers:
37 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010038 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010039 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler5846a6e2023-03-30 17:26:14 +020040 ports: {{ include "common.containerPorts" . | nindent 12 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010041 # 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:
othman touijer5ef62c12021-12-03 09:45:37 +010056 - name: KEY_STORE_PASSWORD
57 value: NotUsed
Sylvain Desbureaux70070412020-11-09 21:58:48 +010058 - name: CONFIG_HOME
59 value: /opt/app/babel/config
efiacord12c1672023-03-23 12:10:50 +000060 volumeMounts:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010061 - mountPath: /etc/localtime
62 name: localtime
63 readOnly: true
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010064 - mountPath: /opt/app/babel/config/application.properties
65 name: config
66 subPath: application.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010067 - mountPath: /opt/app/babel/config/artifact-generator.properties
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010068 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010069 subPath: artifact-generator.properties
70 - mountPath: /opt/app/babel/config/tosca-mappings.json
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010071 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010072 subPath: tosca-mappings.json
73 - mountPath: /opt/app/babel/config/babel-auth.properties
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010074 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010075 subPath: babel-auth.properties
76 - mountPath: /opt/app/babel/config/auth
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010077 name: secrets
Maciej Wereskid523d122021-09-21 11:22:13 +020078 - mountPath: {{ .Values.log.path }}
79 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010080 - mountPath: /opt/app/babel/config/logback.xml
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010081 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010082 subPath: logback.xml
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010083 resources: {{ include "common.resources" . | nindent 12 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010084 {{- if .Values.nodeSelector }}
85 nodeSelector:
86{{ toYaml .Values.nodeSelector | indent 8 }}
87 {{- end -}}
88 {{- if .Values.affinity }}
89 affinity:
90{{ toYaml .Values.affinity | indent 8 }}
91 {{- end }}
92
93 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +020094 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmyd8937332021-03-09 12:20:42 +020095 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
efiacord12c1672023-03-23 12:10:50 +000096 volumes:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010097 - name: localtime
98 hostPath:
99 path: /etc/localtime
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100100 - name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100101 configMap:
102 name: {{ include "common.fullname" . }}-configmap
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100103 - name: secrets
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100104 secret:
105 secretName: {{ include "common.fullname" . }}-babel-secrets
Maciej Wereskid523d122021-09-21 11:22:13 +0200106 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100107 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200108 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100109
110 imagePullSecrets:
111 - name: "{{ include "common.namespace" . }}-docker-registry-key"