[AAI] Remove AAF/TLS config from charts
[oom.git] / kubernetes / aai / components / aai-babel / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 Amdocs, AT&T
3 # Modifications Copyright © 2018 Bell Canada
4 # Modifications Copyright © 2020,2021 Orange
5 # Modifications Copyright © 2023 Nordix Foundation
6 #
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.
18 */}}
19
20 apiVersion: apps/v1
21 kind: Deployment
22 metadata:
23   name: {{ include "common.fullname" . }}
24   namespace: {{ include "common.namespace" . }}
25   labels:
26     app: {{ include "common.name" . }}
27     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
28     release: {{ include "common.release" . }}
29     heritage: {{ .Release.Service }}
30 spec:
31   selector:
32     matchLabels:
33       app: {{ include "common.name" . }}
34   replicas: {{ .Values.replicaCount }}
35   strategy:
36     type: {{ .Values.updateStrategy.type }}
37     {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }}
38     rollingUpdate:
39       maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
40       maxSurge: {{ .Values.updateStrategy.maxSurge }}
41     {{- end }}
42   template:
43     metadata:
44       labels:
45         app: {{ include "common.name" . }}
46         release: {{ include "common.release" . }}
47     spec:
48       initContainers:
49       containers:
50         - name: {{ include "common.name" . }}
51           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
52           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53           ports:
54           - containerPort: {{ .Values.service.internalPort }}
55           # disable liveness probe when breakpoints set in debugger
56           # so K8s doesn't restart unresponsive container
57           {{ if .Values.liveness.enabled }}
58           livenessProbe:
59             tcpSocket:
60               port: {{ .Values.service.internalPort }}
61             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
62             periodSeconds: {{ .Values.liveness.periodSeconds }}
63           {{ end }}
64           readinessProbe:
65             tcpSocket:
66               port: {{ .Values.service.internalPort }}
67             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
68             periodSeconds: {{ .Values.readiness.periodSeconds }}
69           env:
70             - name: KEY_STORE_PASSWORD
71               value: NotUsed
72             - name: CONFIG_HOME
73               value: /opt/app/babel/config
74           volumeMounts:
75           - mountPath: /etc/localtime
76             name: localtime
77             readOnly: true
78           - mountPath: /opt/app/babel/config/application.properties
79             name: config
80             subPath: application.properties
81           - mountPath: /opt/app/babel/config/artifact-generator.properties
82             name: config
83             subPath: artifact-generator.properties
84           - mountPath: /opt/app/babel/config/tosca-mappings.json
85             name: config
86             subPath: tosca-mappings.json
87           - mountPath: /opt/app/babel/config/babel-auth.properties
88             name: config
89             subPath: babel-auth.properties
90           - mountPath: /opt/app/babel/config/auth
91             name: secrets
92           - mountPath: {{ .Values.log.path }}
93             name: logs
94           - mountPath: /opt/app/babel/config/logback.xml
95             name: config
96             subPath: logback.xml
97           resources: {{ include "common.resources" . | nindent 12 }}
98       {{- if .Values.nodeSelector }}
99       nodeSelector:
100 {{ toYaml .Values.nodeSelector | indent 8 }}
101       {{- end -}}
102       {{- if .Values.affinity }}
103       affinity:
104 {{ toYaml .Values.affinity | indent 8 }}
105       {{- end }}
106
107         # side car containers
108       {{ include "common.log.sidecar" . | nindent 8 }}
109       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
110       volumes:
111         - name: localtime
112           hostPath:
113             path: /etc/localtime
114         - name: config
115           configMap:
116             name: {{ include "common.fullname" . }}-configmap
117         - name: secrets
118           secret:
119             secretName: {{ include "common.fullname" . }}-babel-secrets
120         - name: logs
121           emptyDir: {}
122         {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }}
123
124       imagePullSecrets:
125       - name: "{{ include "common.namespace" . }}-docker-registry-key"