blob: 5a9618c5b76b462457f0a069c5bd06c60c76778f [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
Sylvain Desbureaux70070412020-11-09 21:58:48 +01005#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010017*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010018
19apiVersion: apps/v1
20kind: Deployment
21metadata:
22 name: {{ include "common.fullname" . }}
23 namespace: {{ include "common.namespace" . }}
24 labels:
25 app: {{ include "common.name" . }}
26 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
27 release: {{ include "common.release" . }}
28 heritage: {{ .Release.Service }}
29spec:
30 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
33 replicas: {{ .Values.replicaCount }}
Rommel Pawar63db7162022-11-16 10:11:24 -080034 strategy:
35 type: {{ .Values.updateStrategy.type }}
36 {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }}
37 rollingUpdate:
38 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
39 maxSurge: {{ .Values.updateStrategy.maxSurge }}
40 {{- end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010041 template:
42 metadata:
43 labels:
44 app: {{ include "common.name" . }}
45 release: {{ include "common.release" . }}
46 spec:
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010047 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010048 containers:
49 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010050 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010051 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010052 {{- if .Values.global.aafEnabled }}
53 command:
54 - sh
55 args:
56 - -c
57 - |
58 echo "*** retrieve Truststore and Keystore password"
59 export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
60 echo "*** actual launch of AAI Babel"
61 /bin/bash /opt/app/babel/bin/start.sh
62 {{- end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010063 ports:
64 - containerPort: {{ .Values.service.internalPort }}
65 # disable liveness probe when breakpoints set in debugger
66 # so K8s doesn't restart unresponsive container
67 {{ if .Values.liveness.enabled }}
68 livenessProbe:
69 tcpSocket:
70 port: {{ .Values.service.internalPort }}
71 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.liveness.periodSeconds }}
73 {{ end }}
74 readinessProbe:
75 tcpSocket:
76 port: {{ .Values.service.internalPort }}
77 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
78 periodSeconds: {{ .Values.readiness.periodSeconds }}
79 env:
othman touijer5ef62c12021-12-03 09:45:37 +010080 {{- if not (include "common.needTLS" .) }}
81 - name: KEY_STORE_PASSWORD
82 value: NotUsed
83 {{- end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010084 - name: CONFIG_HOME
85 value: /opt/app/babel/config
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010086 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010087 - mountPath: /etc/localtime
88 name: localtime
89 readOnly: true
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010090 - mountPath: /opt/app/babel/config/application.properties
91 name: config
92 subPath: application.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010093 - mountPath: /opt/app/babel/config/artifact-generator.properties
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010094 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010095 subPath: artifact-generator.properties
96 - mountPath: /opt/app/babel/config/tosca-mappings.json
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010097 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010098 subPath: tosca-mappings.json
99 - mountPath: /opt/app/babel/config/babel-auth.properties
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100100 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100101 subPath: babel-auth.properties
102 - mountPath: /opt/app/babel/config/auth
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100103 name: secrets
Maciej Wereskid523d122021-09-21 11:22:13 +0200104 - mountPath: {{ .Values.log.path }}
105 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100106 - mountPath: /opt/app/babel/config/logback.xml
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100107 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100108 subPath: logback.xml
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100109 resources: {{ include "common.resources" . | nindent 12 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100110 {{- if .Values.nodeSelector }}
111 nodeSelector:
112{{ toYaml .Values.nodeSelector | indent 8 }}
113 {{- end -}}
114 {{- if .Values.affinity }}
115 affinity:
116{{ toYaml .Values.affinity | indent 8 }}
117 {{- end }}
118
119 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200120 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmyd8937332021-03-09 12:20:42 +0200121 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100122 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100123 - name: localtime
124 hostPath:
125 path: /etc/localtime
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100126 - name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100127 configMap:
128 name: {{ include "common.fullname" . }}-configmap
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100129 - name: secrets
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100130 secret:
131 secretName: {{ include "common.fullname" . }}-babel-secrets
Maciej Wereskid523d122021-09-21 11:22:13 +0200132 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100133 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200134 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100135
136 imagePullSecrets:
137 - name: "{{ include "common.namespace" . }}-docker-registry-key"