blob: e2925f6b618da854457eccaa313b300a39ab48a0 [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:
AndrewLamb8e090442020-10-15 09:28:09 +010032 containers:
33 - name: {{ include "common.name" . }}
34 command:
35 - sh
36 args:
37 - -c
38 - |
39 export ETSI_NFVO_PASSWORD=`htpasswd -bnBC 10 "" $ETSI_NFVO_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'`
AndrewLamb8e090442020-10-15 09:28:09 +010040 ./start-app.sh
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010041 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
AndrewLamb8e090442020-10-15 09:28:09 +010042 resources: {{ include "common.resources" . | nindent 12 }}
43 env:
44 - name: ETSI_NFVO_USERNAME
45 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "etsi-nfvo-nslcm-creds" "key" "login") | indent 14 }}
46 - name: ETSI_NFVO_PASSWORD_INPUT
47 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "etsi-nfvo-nslcm-creds" "key" "password") | indent 14 }}
rope2524d3f3682020-09-02 20:49:21 +010048 - name: DB_HOST
krishnaa9692b606b2020-10-30 11:29:21 +053049 value: {{ include "common.mariadbService" . }}
rope2524d3f3682020-09-02 20:49:21 +010050 - name: DB_PORT
krishnaa9692b606b2020-10-30 11:29:21 +053051 value: {{ include "common.mariadbPort" . | quote }}
rope2524d3f3682020-09-02 20:49:21 +010052 - name: DB_USERNAME
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }}
54 - name: DB_PASSWORD
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }}
56 - name: DB_ADMIN_USERNAME
57 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }}
58 - name: DB_ADMIN_PASSWORD
59 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }}
AndrewLamb8e090442020-10-15 09:28:09 +010060 envFrom:
61 - configMapRef:
62 name: {{ include "common.fullname" . }}-configmap
63 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010064 volumeMounts:
AndrewLamb8e090442020-10-15 09:28:09 +010065 - name: logs
66 mountPath: /app/logs
67 - name: config
68 mountPath: /app/config
69 readOnly: true
AndrewLamb8e090442020-10-15 09:28:09 +010070 livenessProbe:
71 tcpSocket:
72 port: {{ index .Values.livenessProbe.port }}
73 initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}}
74 periodSeconds: {{ index .Values.livenessProbe.periodSeconds}}
75 successThreshold: {{ index .Values.livenessProbe.successThreshold}}
76 failureThreshold: {{ index .Values.livenessProbe.failureThreshold}}
77 ports: {{ include "common.containerPorts" . | nindent 12 }}
farida azmy87f46222021-04-06 15:25:15 +020078 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010079 volumes:
AndrewLamb8e090442020-10-15 09:28:09 +010080 - name: logs
81 emptyDir: {}
82 - name: config
83 configMap:
84 name: {{ include "common.fullname" . }}-app-configmap
AndrewLamb8e090442020-10-15 09:28:09 +010085 imagePullSecrets:
86 - name: "{{ include "common.namespace" . }}-docker-registry-key"