[AAI] Remove AAF/TLS config from charts
[oom.git] / kubernetes / aai / components / aai-sparky-be / templates / deployment.yaml
1 {{/*
2 # Copyright (c) 2017 Amdocs, Bell Canada
3 # Modifications Copyright (c) 2018 AT&T
4 # Modifications Copyright (c) 2020 Nokia
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   replicas: {{ .Values.replicaCount }}
32   strategy:
33     type: {{ .Values.updateStrategy.type }}
34     {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }}
35     rollingUpdate:
36       maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
37       maxSurge: {{ .Values.updateStrategy.maxSurge }}
38     {{- end }}
39   selector:
40     matchLabels:
41       app: {{ include "common.name" . }}
42   template:
43     metadata:
44       annotations:
45         sidecar.istio.io/rewriteAppHTTPProbers: "false"
46       labels:
47         app: {{ include "common.name" . }}
48         release: {{ include "common.release" . }}
49       name: {{ include "common.name" . }}
50     spec:
51       initContainers:
52       - command:
53         - /app/ready.py
54         args:
55         - --container-name
56         - aai
57         env:
58         - name: NAMESPACE
59           valueFrom:
60             fieldRef:
61               apiVersion: v1
62               fieldPath: metadata.namespace
63         image: {{ include "repositoryGenerator.image.readiness" . }}
64         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
65         name: {{ include "common.name" . }}-readiness
66       containers:
67       - name: {{ include "common.name" . }}
68         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
69         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
70         command:
71         - sh
72         args:
73         - -c
74         - |
75           echo "*** actual launch of AAI Sparky BE"
76           /opt/app/sparky/bin/start.sh
77         volumeMounts:
78         - mountPath: /etc/localtime
79           name: localtime
80           readOnly: true
81         - mountPath: {{ .Values.log.path }}
82           name: logs
83         - mountPath:  /opt/app/sparky/config/application.properties
84           name: config
85           subPath: application.properties
86         - mountPath:  /opt/app/sparky/config/application-resources.properties
87           name: config
88           subPath: application-resources.properties
89         - mountPath:  /opt/app/sparky/config/application-ssl.properties
90           name: config
91           subPath: application-ssl.properties
92         - mountPath:  /opt/app/sparky/config/application-oxm-default.properties
93           name: config
94           subPath: application-oxm-default.properties
95         - mountPath:  /opt/app/sparky/config/application-oxm-override.properties
96           name: config
97           subPath: application-oxm-override.properties
98         - mountPath:  /opt/app/sparky/config/application-oxm-schema-prod.properties
99           name: config
100           subPath: application-oxm-schema-prod.properties
101         - mountPath:  /opt/app/sparky/config/roles.config
102           name: config
103           subPath: roles.config
104         - mountPath:  /opt/app/sparky/config/users.config
105           name: config
106           subPath: users.config
107         - mountPath:  /opt/app/sparky/config/logging/logback.xml
108           name: config
109           subPath: logback.xml
110         ports:
111         - containerPort: {{ .Values.service.internalPort }}
112         - containerPort: {{ .Values.service.internalPlainPort }}
113         # disable liveness probe when breakpoints set in debugger
114         # so K8s doesn't restart unresponsive container
115         {{- if eq .Values.liveness.enabled true }}
116         livenessProbe:
117           tcpSocket:
118             port: {{ .Values.service.internalPlainPort }}
119           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
120           periodSeconds: {{ .Values.liveness.periodSeconds }}
121         {{ end -}}
122         readinessProbe:
123           tcpSocket:
124             port: {{ .Values.service.internalPlainPort }}
125           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
126           periodSeconds: {{ .Values.readiness.periodSeconds }}
127         resources: {{ include "common.resources" . | nindent 10 }}
128       {{- if .Values.nodeSelector }}
129       nodeSelector:
130 {{ toYaml .Values.nodeSelector | indent 8 }}
131       {{- end -}}
132       {{- if .Values.affinity }}
133       affinity:
134 {{ toYaml .Values.affinity | indent 8 }}
135       {{- end }}
136
137       # side car containers
138       {{ include "common.log.sidecar" . | nindent 6 }}
139       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
140       volumes:
141       - name: localtime
142         hostPath:
143           path: /etc/localtime
144       - name: config
145         configMap:
146           name: {{ include "common.fullname" . }}
147       - name: logs
148         emptyDir: {}
149         {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
150       - name: modeldir
151         emptyDir: {}
152       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
153       imagePullSecrets:
154       - name: "{{ include "common.namespace" . }}-docker-registry-key"