blob: 21f278b08763f02966f33c55c03736caae4f496d [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 }}
42 export $(grep '^c' {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0)
43 export TRUSTSTORE_PASSWORD="${cadi_truststore_password}"
44 {{- if .Values.global.security.aaf.enabled }}
45 export KEYSTORE_PASSWORD="${cadi_keystore_password}"
46 {{- end }}
47 {{- end }}
48 ./start-app.sh
49 image: {{ include "common.repository" . }}/{{ .Values.image }}
50 resources: {{ include "common.resources" . | nindent 12 }}
51 env:
52 - name: ETSI_NFVO_USERNAME
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "etsi-nfvo-nslcm-creds" "key" "login") | indent 14 }}
54 - name: ETSI_NFVO_PASSWORD_INPUT
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "etsi-nfvo-nslcm-creds" "key" "password") | indent 14 }}
rope2524d3f3682020-09-02 20:49:21 +010056 - name: DB_HOST
57 valueFrom:
58 secretKeyRef:
59 name: {{ include "common.release" . }}-so-db-secrets
60 key: mariadb.readwrite.host
61 - name: DB_PORT
62 valueFrom:
63 secretKeyRef:
64 name: {{ include "common.release" . }}-so-db-secrets
65 key: mariadb.readwrite.port
66 - name: DB_USERNAME
67 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }}
68 - name: DB_PASSWORD
69 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }}
70 - name: DB_ADMIN_USERNAME
71 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }}
72 - name: DB_ADMIN_PASSWORD
73 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }}
AndrewLamb8e090442020-10-15 09:28:09 +010074 {{ include "so.certificates.env" . | indent 12 | trim }}
75 envFrom:
76 - configMapRef:
77 name: {{ include "common.fullname" . }}-configmap
78 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
79 volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 12 }}
80 - name: logs
81 mountPath: /app/logs
82 - name: config
83 mountPath: /app/config
84 readOnly: true
85 - name: {{ include "common.fullname" . }}-truststore
86 mountPath: /app/client
87 readonly: true
88 livenessProbe:
89 tcpSocket:
90 port: {{ index .Values.livenessProbe.port }}
91 initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}}
92 periodSeconds: {{ index .Values.livenessProbe.periodSeconds}}
93 successThreshold: {{ index .Values.livenessProbe.successThreshold}}
94 failureThreshold: {{ index .Values.livenessProbe.failureThreshold}}
95 ports: {{ include "common.containerPorts" . | nindent 12 }}
96 volumes: {{ include "so.certificate.volumes" . | nindent 8 }}
97 - name: logs
98 emptyDir: {}
99 - name: config
100 configMap:
101 name: {{ include "common.fullname" . }}-app-configmap
102 - name: {{ include "common.fullname" . }}-truststore
103 secret:
104 secretName: {{ include "common.release" . }}-so-truststore-secret
105 imagePullSecrets:
106 - name: "{{ include "common.namespace" . }}-docker-registry-key"