blob: e12a234b8edb2d688cdba5880caba19c2576e4fe [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 Desbureaux70070412020-11-09 21:58:48 +010040 containers:
41 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010042 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010043 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
44 ports:
45 - containerPort: {{ .Values.service.internalPort }}
46 # disable liveness probe when breakpoints set in debugger
47 # so K8s doesn't restart unresponsive container
48 {{ if .Values.liveness.enabled }}
49 livenessProbe:
50 tcpSocket:
51 port: {{ .Values.service.internalPort }}
52 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
53 periodSeconds: {{ .Values.liveness.periodSeconds }}
54 {{ end }}
55 readinessProbe:
56 tcpSocket:
57 port: {{ .Values.service.internalPort }}
58 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
59 periodSeconds: {{ .Values.readiness.periodSeconds }}
60 env:
61 - name: CONFIG_HOME
62 value: /opt/app/babel/config
63 - name: KEY_STORE_PASSWORD
64 valueFrom:
65 secretKeyRef:
66 name: {{ template "common.fullname" . }}-pass
67 key: KEY_STORE_PASSWORD
68 - name: KEY_MANAGER_PASSWORD
69 valueFrom:
70 secretKeyRef:
71 name: {{ template "common.fullname" . }}-pass
72 key: KEY_MANAGER_PASSWORD
73 volumeMounts:
74 - mountPath: /etc/localtime
75 name: localtime
76 readOnly: true
77 - mountPath: /opt/app/babel/config/artifact-generator.properties
78 name: {{ include "common.fullname" . }}-config
79 subPath: artifact-generator.properties
80 - mountPath: /opt/app/babel/config/tosca-mappings.json
81 name: {{ include "common.fullname" . }}-config
82 subPath: tosca-mappings.json
83 - mountPath: /opt/app/babel/config/babel-auth.properties
84 name: {{ include "common.fullname" . }}-config
85 subPath: babel-auth.properties
86 - mountPath: /opt/app/babel/config/auth
87 name: {{ include "common.fullname" . }}-secrets
Maciej Wereskid523d122021-09-21 11:22:13 +020088 - mountPath: {{ .Values.log.path }}
89 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010090 - mountPath: /opt/app/babel/config/logback.xml
91 name: {{ include "common.fullname" . }}-config
92 subPath: logback.xml
93 resources:
94{{ include "common.resources" . }}
95 {{- if .Values.nodeSelector }}
96 nodeSelector:
97{{ toYaml .Values.nodeSelector | indent 8 }}
98 {{- end -}}
99 {{- if .Values.affinity }}
100 affinity:
101{{ toYaml .Values.affinity | indent 8 }}
102 {{- end }}
103
104 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200105 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmyd8937332021-03-09 12:20:42 +0200106 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100107 volumes:
108 - name: localtime
109 hostPath:
110 path: /etc/localtime
111 - name: {{ include "common.fullname" . }}-config
112 configMap:
113 name: {{ include "common.fullname" . }}-configmap
114 items:
115 - key: artifact-generator.properties
116 path: artifact-generator.properties
117 - key: tosca-mappings.json
118 path: tosca-mappings.json
119 - key: babel-auth.properties
120 path: babel-auth.properties
121 - key: logback.xml
122 path: logback.xml
123 - name: {{ include "common.fullname" . }}-secrets
124 secret:
125 secretName: {{ include "common.fullname" . }}-babel-secrets
Maciej Wereskid523d122021-09-21 11:22:13 +0200126 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100127 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200128 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100129
130 imagePullSecrets:
131 - name: "{{ include "common.namespace" . }}-docker-registry-key"