blob: c33dcb7f3220e6af6edb0e36d7c20587c8e949d8 [file] [log] [blame]
Jakub Latusek44f0fdd2020-10-21 13:36:29 +02001{{/*
AndrewLamb8e090442020-10-15 09:28:09 +01002# Copyright © 2020 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*/}}
AndrewLamb8e090442020-10-15 09:28:09 +010016
17apiVersion: apps/v1
18kind: Deployment
19metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20spec:
21 selector: {{- include "common.selectors" . | nindent 4 }}
22 replicas: {{ index .Values.replicaCount }}
23 minReadySeconds: {{ index .Values.minReadySeconds }}
24 strategy:
25 type: {{ index .Values.updateStrategy.type }}
26 rollingUpdate:
27 maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }}
28 maxSurge: {{ index .Values.updateStrategy.maxSurge }}
29 template:
30 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
31 spec:
32 initContainers: {{ include "so.certificate.container_importer" . | nindent 8 }}
33 containers:
34 - name: {{ include "common.name" . }}
35 command:
36 - sh
37 args:
38 - -c
39 - |
40 export ETSI_NFVO_PASSWORD=`htpasswd -bnBC 10 "" $ETSI_NFVO_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'`
41 {{- if .Values.global.aafEnabled }}
Sylvain Desbureauxfde94072021-03-19 15:06:41 +010042 export $(cat {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0)
AndrewLamb8e090442020-10-15 09:28:09 +010043 {{- if .Values.global.security.aaf.enabled }}
Sylvain Desbureauxa1bbe5c2020-10-28 16:55:18 +010044 export KEYSTORE_PASSWORD="${cadi_keystore_password_p12}"
AndrewLamb8e090442020-10-15 09:28:09 +010045 {{- end }}
46 {{- end }}
47 ./start-app.sh
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010048 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
AndrewLamb8e090442020-10-15 09:28:09 +010049 resources: {{ include "common.resources" . | nindent 12 }}
50 env:
51 - name: ETSI_NFVO_USERNAME
52 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "etsi-nfvo-nslcm-creds" "key" "login") | indent 14 }}
53 - name: ETSI_NFVO_PASSWORD_INPUT
54 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "etsi-nfvo-nslcm-creds" "key" "password") | indent 14 }}
rope2524d3f3682020-09-02 20:49:21 +010055 - name: DB_HOST
krishnaa9692b606b2020-10-30 11:29:21 +053056 value: {{ include "common.mariadbService" . }}
rope2524d3f3682020-09-02 20:49:21 +010057 - name: DB_PORT
krishnaa9692b606b2020-10-30 11:29:21 +053058 value: {{ include "common.mariadbPort" . | quote }}
rope2524d3f3682020-09-02 20:49:21 +010059 - name: DB_USERNAME
60 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }}
61 - name: DB_PASSWORD
62 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }}
63 - name: DB_ADMIN_USERNAME
64 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }}
65 - name: DB_ADMIN_PASSWORD
66 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }}
AndrewLamb8e090442020-10-15 09:28:09 +010067 {{ include "so.certificates.env" . | indent 12 | trim }}
68 envFrom:
69 - configMapRef:
70 name: {{ include "common.fullname" . }}-configmap
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 12 }}
73 - name: logs
74 mountPath: /app/logs
75 - name: config
76 mountPath: /app/config
77 readOnly: true
AndrewLamb8e090442020-10-15 09:28:09 +010078 livenessProbe:
79 tcpSocket:
80 port: {{ index .Values.livenessProbe.port }}
81 initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}}
82 periodSeconds: {{ index .Values.livenessProbe.periodSeconds}}
83 successThreshold: {{ index .Values.livenessProbe.successThreshold}}
84 failureThreshold: {{ index .Values.livenessProbe.failureThreshold}}
85 ports: {{ include "common.containerPorts" . | nindent 12 }}
86 volumes: {{ include "so.certificate.volumes" . | nindent 8 }}
87 - name: logs
88 emptyDir: {}
89 - name: config
90 configMap:
91 name: {{ include "common.fullname" . }}-app-configmap
AndrewLamb8e090442020-10-15 09:28:09 +010092 imagePullSecrets:
93 - name: "{{ include "common.namespace" . }}-docker-registry-key"