blob: 3272bfd2999b2abb52d90153bd3f9f123f7ca453 [file] [log] [blame]
Jakub Latusek44f0fdd2020-10-21 13:36:29 +02001{{/*
MichaelMorris74fda382019-03-17 09:36:27 +00002# Copyright © 2019 Nordix Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Jakub Latusek44f0fdd2020-10-21 13:36:29 +020015*/}}
Grzegorz-Lisd1c1f6a2020-07-29 12:22:40 +020016apiVersion: apps/v1
MichaelMorris74fda382019-03-17 09:36:27 +000017kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.fullname" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
MichaelMorris74fda382019-03-17 09:36:27 +000025spec:
Grzegorz-Lisd1c1f6a2020-07-29 12:22:40 +020026 selector:
27 matchLabels:
28 app: {{ include "common.name" . }}
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010029 replicas: {{ .Values.replicaCount }}
30 minReadySeconds: {{ .Values.minReadySeconds }}
MichaelMorris74fda382019-03-17 09:36:27 +000031 strategy:
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010032 type: {{ .Values.updateStrategy.type }}
MichaelMorris74fda382019-03-17 09:36:27 +000033 rollingUpdate:
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010034 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
35 maxSurge: {{ .Values.updateStrategy.maxSurge }}
MichaelMorris74fda382019-03-17 09:36:27 +000036 template:
37 metadata:
38 labels:
39 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010040 release: {{ include "common.release" . }}
MichaelMorris74fda382019-03-17 09:36:27 +000041 spec:
Sylvain Desbureauxaadf5452020-03-18 18:13:51 +010042 initContainers: {{ include "so.certificate.container_importer" . | nindent 6 }}
MichaelMorris74fda382019-03-17 09:36:27 +000043 containers:
44 - name: {{ include "common.name" . }}
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010045 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
seshukm0df1f8e2020-08-17 21:45:49 +053046 resources: {{ include "common.resources" . | nindent 12 }}
47 {{- if .Values.global.aafEnabled }}
48 command:
49 - sh
50 args:
51 - -c
52 - |
Sylvain Desbureauxfde94072021-03-19 15:06:41 +010053 export $(cat {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0)
Sylvain Desbureauxa1bbe5c2020-10-28 16:55:18 +010054 export KEYSTORE_PASSWORD="${cadi_keystore_password_p12}"
55 export KEYSTORE="{{ .Values.soHelpers.certInitializer.credsPath }}/org.onap.so.p12"
seshukm0df1f8e2020-08-17 21:45:49 +053056 /app/start-app.sh
Ramesh Parthasarathy95dc1c92020-02-05 17:02:28 +000057 {{- end }}
seshukm0df1f8e2020-08-17 21:45:49 +053058 env:
59 {{ include "so.certificates.env" . | indent 8 | trim }}
MichaelMorris74fda382019-03-17 09:36:27 +000060 envFrom:
61 - configMapRef:
62 name: {{ include "common.fullname" . }}-configmap
63 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
seshukm0df1f8e2020-08-17 21:45:49 +053064 volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 8 }}
MichaelMorris74fda382019-03-17 09:36:27 +000065 - name: logs
66 mountPath: /app/logs
67 - name: config
68 mountPath: /app/config
69 readOnly: true
70 livenessProbe:
71 tcpSocket:
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010072 port: {{ .Values.livenessProbe.port }}
73 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds}}
74 periodSeconds: {{ .Values.livenessProbe.periodSeconds}}
75 successThreshold: {{ .Values.livenessProbe.successThreshold}}
76 failureThreshold: {{ .Values.livenessProbe.failureThreshold}}
MichaelMorris74fda382019-03-17 09:36:27 +000077 ports:
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010078 - containerPort: {{ .Values.containerPort }}
MichaelMorris74fda382019-03-17 09:36:27 +000079 name: {{ .Values.service.portName }}
80 protocol: TCP
farida azmy87f46222021-04-06 15:25:15 +020081 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Sylvain Desbureauxaadf5452020-03-18 18:13:51 +010082 volumes: {{ include "so.certificate.volumes" . | nindent 6 }}
MichaelMorris74fda382019-03-17 09:36:27 +000083 - name: logs
84 emptyDir: {}
85 - name: config
86 configMap:
87 name: {{ include "common.fullname" . }}-app-configmap
MichaelMorris74fda382019-03-17 09:36:27 +000088 imagePullSecrets:
89 - name: "{{ include "common.namespace" . }}-docker-registry-key"