blob: 8abd9a9796885cdb467ee8311d3d17c09522c966 [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 - |
53 export $(grep '^c' {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0)
54 export TRUSTSTORE_PASSWORD="${cadi_truststore_password}"
Sylvain Desbureauxa1bbe5c2020-10-28 16:55:18 +010055 export KEYSTORE_PASSWORD="${cadi_keystore_password_p12}"
56 export KEYSTORE="{{ .Values.soHelpers.certInitializer.credsPath }}/org.onap.so.p12"
seshukm0df1f8e2020-08-17 21:45:49 +053057 /app/start-app.sh
Ramesh Parthasarathy95dc1c92020-02-05 17:02:28 +000058 {{- end }}
seshukm0df1f8e2020-08-17 21:45:49 +053059 env:
60 {{ include "so.certificates.env" . | indent 8 | trim }}
MichaelMorris74fda382019-03-17 09:36:27 +000061 envFrom:
62 - configMapRef:
63 name: {{ include "common.fullname" . }}-configmap
64 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
seshukm0df1f8e2020-08-17 21:45:49 +053065 volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 8 }}
MichaelMorris74fda382019-03-17 09:36:27 +000066 - name: logs
67 mountPath: /app/logs
68 - name: config
69 mountPath: /app/config
70 readOnly: true
71 livenessProbe:
72 tcpSocket:
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010073 port: {{ .Values.livenessProbe.port }}
74 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds}}
75 periodSeconds: {{ .Values.livenessProbe.periodSeconds}}
76 successThreshold: {{ .Values.livenessProbe.successThreshold}}
77 failureThreshold: {{ .Values.livenessProbe.failureThreshold}}
MichaelMorris74fda382019-03-17 09:36:27 +000078 ports:
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010079 - containerPort: {{ .Values.containerPort }}
MichaelMorris74fda382019-03-17 09:36:27 +000080 name: {{ .Values.service.portName }}
81 protocol: TCP
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"