blob: 75d831eba689a3e1f03aff26f96590021188c79d [file] [log] [blame]
Jakub Latusek44f0fdd2020-10-21 13:36:29 +02001{{/*
jananib28734e02020-04-08 21:35:45 +05302# Copyright © 2020 Huawei Technologies Co., Ltd.
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*/}}
jananib28734e02020-04-08 21:35:45 +053016apiVersion: apps/v1
17kind: Deployment
18metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
19spec:
20 selector: {{- include "common.selectors" . | nindent 4 }}
21 replicas: {{ index .Values.replicaCount }}
22 minReadySeconds: {{ index .Values.minReadySeconds }}
23 strategy:
24 type: {{ index .Values.updateStrategy.type }}
25 rollingUpdate:
26 maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }}
27 maxSurge: {{ index .Values.updateStrategy.maxSurge }}
28 template:
29 metadata:
30 labels: {{- include "common.labels" . | nindent 8 }}
31 spec:
Sylvain Desbureauxd055a172020-10-30 14:32:03 +010032 initContainers:
33 {{ include "so.certificate.container_importer" . | indent 6 | trim }}
34 {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
jananib28734e02020-04-08 21:35:45 +053035 containers:
36 - name: {{ include "common.name" . }}
37 command:
38 - sh
39 args:
40 - -c
seshukm0df1f8e2020-08-17 21:45:49 +053041 - |
42 export BPEL_PASSWORD=`htpasswd -bnBC 10 "" $BPEL_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'`
43 export ACTUATOR_PASSWORD=`htpasswd -bnBC 10 "" $ACTUATOR_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'`
44 {{- if .Values.global.aafEnabled }}
45 export $(grep '^c' {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0)
46 export TRUSTSTORE_PASSWORD="${cadi_truststore_password}"
47 {{- if .Values.global.security.aaf.enabled }}
Sylvain Desbureauxa1bbe5c2020-10-28 16:55:18 +010048 export KEYSTORE_PASSWORD="${cadi_keystore_password_p12}"
seshukm0df1f8e2020-08-17 21:45:49 +053049 {{- end }}
50 {{- end }}
51 ./start-app.sh
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010052 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
jananib28734e02020-04-08 21:35:45 +053053 resources: {{ include "common.resources" . | nindent 12 }}
54 ports: {{- include "common.containerPorts" . | nindent 12 }}
55 env:
56 - name: DB_HOST
krishnaa9692b606b2020-10-30 11:29:21 +053057 value: {{ include "common.mariadbService" . }}
jananib28734e02020-04-08 21:35:45 +053058 - name: DB_PORT
krishnaa9692b606b2020-10-30 11:29:21 +053059 value: {{ include "common.mariadbPort" . | quote }}
jananib28734e02020-04-08 21:35:45 +053060 - name: DB_USERNAME
61 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }}
62 - name: DB_PASSWORD
63 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }}
64 - name: DB_ADMIN_USERNAME
65 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }}
66 - name: DB_ADMIN_PASSWORD
67 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }}
jananib28734e02020-04-08 21:35:45 +053068 - name: BPEL_USERNAME
69 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-bpel-creds" "key" "login") | indent 14 }}
70 - name: BPEL_PASSWORD_INPUT
71 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-bpel-creds" "key" "password") | indent 14 }}
72 - name: ACTUATOR_USERNAME
73 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-actuator-creds" "key" "login") | indent 14 }}
74 - name: ACTUATOR_PASSWORD_INPUT
75 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-actuator-creds" "key" "password") | indent 14 }}
Krzysztof Opasiak098ff422020-10-21 13:06:52 +020076 {{ include "so.certificates.env" . | nindent 12 }}
jananib28734e02020-04-08 21:35:45 +053077 envFrom:
78 - configMapRef:
79 name: {{ include "common.fullname" . }}-env
80 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
seshukm0df1f8e2020-08-17 21:45:49 +053081 volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 12 }}
jananib28734e02020-04-08 21:35:45 +053082 - name: logs
83 mountPath: /app/logs
84 - name: config
85 mountPath: /app/config
86 readOnly: true
jananib28734e02020-04-08 21:35:45 +053087 livenessProbe:
88 httpGet:
89 path: {{ index .Values.livenessProbe.path}}
90 port: {{ index .Values.containerPort }}
91 scheme: {{ index .Values.livenessProbe.scheme}}
92 initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}}
93 periodSeconds: {{ index .Values.livenessProbe.periodSeconds}}
94 timeoutSeconds: {{ index .Values.livenessProbe.timeoutSeconds}}
95 successThreshold: {{ index .Values.livenessProbe.successThreshold}}
96 failureThreshold: {{ index .Values.livenessProbe.failureThreshold}}
97 volumes: {{ include "so.certificate.volumes" . | nindent 8 }}
98 - name: logs
99 emptyDir: {}
100 - name: config
101 configMap:
102 name: {{ include "common.fullname" . }}
jananib28734e02020-04-08 21:35:45 +0530103 imagePullSecrets:
104 - name: "{{ include "common.namespace" . }}-docker-registry-key"