blob: bd6b8c728ceffb2a2b716bc7fadfecea87ef7be9 [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 }}
34 template:
35 metadata:
36 labels:
37 app: {{ include "common.name" . }}
38 release: {{ include "common.release" . }}
39 spec:
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010040 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010041 containers:
42 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010043 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010044 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010045 {{- if .Values.global.aafEnabled }}
46 command:
47 - sh
48 args:
49 - -c
50 - |
51 echo "*** retrieve Truststore and Keystore password"
52 export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
53 echo "*** actual launch of AAI Babel"
54 /bin/bash /opt/app/babel/bin/start.sh
55 {{- end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010056 ports:
57 - containerPort: {{ .Values.service.internalPort }}
58 # disable liveness probe when breakpoints set in debugger
59 # so K8s doesn't restart unresponsive container
60 {{ if .Values.liveness.enabled }}
61 livenessProbe:
62 tcpSocket:
63 port: {{ .Values.service.internalPort }}
64 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
65 periodSeconds: {{ .Values.liveness.periodSeconds }}
66 {{ end }}
67 readinessProbe:
68 tcpSocket:
69 port: {{ .Values.service.internalPort }}
70 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
71 periodSeconds: {{ .Values.readiness.periodSeconds }}
72 env:
73 - name: CONFIG_HOME
74 value: /opt/app/babel/config
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010075 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010076 - mountPath: /etc/localtime
77 name: localtime
78 readOnly: true
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010079 - mountPath: /opt/app/babel/config/application.properties
80 name: config
81 subPath: application.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010082 - mountPath: /opt/app/babel/config/artifact-generator.properties
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010083 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010084 subPath: artifact-generator.properties
85 - mountPath: /opt/app/babel/config/tosca-mappings.json
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010086 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010087 subPath: tosca-mappings.json
88 - mountPath: /opt/app/babel/config/babel-auth.properties
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010089 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010090 subPath: babel-auth.properties
91 - mountPath: /opt/app/babel/config/auth
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010092 name: secrets
Maciej Wereskid523d122021-09-21 11:22:13 +020093 - mountPath: {{ .Values.log.path }}
94 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010095 - mountPath: /opt/app/babel/config/logback.xml
Sylvain Desbureaux1e997192021-02-28 14:59:22 +010096 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010097 subPath: logback.xml
98 resources:
99{{ include "common.resources" . }}
100 {{- if .Values.nodeSelector }}
101 nodeSelector:
102{{ toYaml .Values.nodeSelector | indent 8 }}
103 {{- end -}}
104 {{- if .Values.affinity }}
105 affinity:
106{{ toYaml .Values.affinity | indent 8 }}
107 {{- end }}
108
109 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200110 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmyd8937332021-03-09 12:20:42 +0200111 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100112 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100113 - name: localtime
114 hostPath:
115 path: /etc/localtime
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100116 - name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100117 configMap:
118 name: {{ include "common.fullname" . }}-configmap
Sylvain Desbureaux1e997192021-02-28 14:59:22 +0100119 - name: secrets
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100120 secret:
121 secretName: {{ include "common.fullname" . }}-babel-secrets
Maciej Wereskid523d122021-09-21 11:22:13 +0200122 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100123 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200124 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100125
126 imagePullSecrets:
127 - name: "{{ include "common.namespace" . }}-docker-registry-key"