Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / vnfsdk / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
3 # Modifications © 2023 Deutsche Telekom
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 */}}
17
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
21 spec:
22   selector: {{- include "common.selectors" . | nindent 4 }}
23   replicas: {{ .Values.replicaCount }}
24   template:
25     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26     spec:
27       initContainers:
28       - command:
29         - sh
30         args:
31         - -c
32         - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
33         env:
34         - name: PG_USER
35           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
36         - name: PG_PASSWORD
37           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
38         volumeMounts:
39         - mountPath: /config-input
40           name: init-data-input
41         - mountPath: /config
42           name: init-data
43         image: {{ include "repositoryGenerator.image.envsubst" . }}
44         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45         name: {{ include "common.name" . }}-update-config
46       {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
47       containers:
48       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
49         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50         name: {{ include "common.name" . }}
51         ports: {{ include "common.containerPorts" . | nindent 8  }}
52         resources: {{ include "common.resources" . | nindent 10 }}
53         volumeMounts:
54         - mountPath: /service/webapps/ROOT/WEB-INF/classes/mybatis/configuration/configuration.xml
55           name: init-data
56           subPath: configuration.xml
57         - mountPath: /etc/nginx/nginx.conf
58           name: nginx
59           subPath: nginx.conf
60         readinessProbe:
61           tcpSocket:
62             port: {{ .Values.service.internalPort }}
63           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
64           periodSeconds: {{ .Values.readiness.periodSeconds }}
65       {{- include "common.imagePullSecrets" . | nindent 6 }}
66       volumes:
67       - name: init-data-input
68         configMap:
69           name: {{ include "common.fullname" . }}
70       - name: nginx
71         configMap:
72           name: {{ include "common.fullname" . }}-nginx
73       - name: init-data
74         emptyDir:
75           medium: Memory