blob: 32a9eff67d6c709270f6197254f786c43350045b [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:
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010029 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
jananib28734e02020-04-08 21:35:45 +053030 spec:
Sylvain Desbureauxd055a172020-10-30 14:32:03 +010031 initContainers:
Sylvain Desbureauxd055a172020-10-30 14:32:03 +010032 {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
jananib28734e02020-04-08 21:35:45 +053033 containers:
34 - name: {{ include "common.name" . }}
35 command:
36 - sh
37 args:
38 - -c
seshukm0df1f8e2020-08-17 21:45:49 +053039 - |
40 export BPEL_PASSWORD=`htpasswd -bnBC 10 "" $BPEL_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'`
41 export ACTUATOR_PASSWORD=`htpasswd -bnBC 10 "" $ACTUATOR_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'`
seshukm0df1f8e2020-08-17 21:45:49 +053042 ./start-app.sh
Sylvain Desbureaux747982c2020-11-19 17:40:05 +010043 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
jananib28734e02020-04-08 21:35:45 +053044 resources: {{ include "common.resources" . | nindent 12 }}
45 ports: {{- include "common.containerPorts" . | nindent 12 }}
46 env:
47 - name: DB_HOST
krishnaa9692b606b2020-10-30 11:29:21 +053048 value: {{ include "common.mariadbService" . }}
jananib28734e02020-04-08 21:35:45 +053049 - name: DB_PORT
krishnaa9692b606b2020-10-30 11:29:21 +053050 value: {{ include "common.mariadbPort" . | quote }}
jananib28734e02020-04-08 21:35:45 +053051 - name: DB_USERNAME
52 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }}
53 - name: DB_PASSWORD
54 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }}
55 - name: DB_ADMIN_USERNAME
56 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }}
57 - name: DB_ADMIN_PASSWORD
58 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }}
jananib28734e02020-04-08 21:35:45 +053059 - name: BPEL_USERNAME
60 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-bpel-creds" "key" "login") | indent 14 }}
61 - name: BPEL_PASSWORD_INPUT
62 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-bpel-creds" "key" "password") | indent 14 }}
63 - name: ACTUATOR_USERNAME
64 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-actuator-creds" "key" "login") | indent 14 }}
65 - name: ACTUATOR_PASSWORD_INPUT
66 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-actuator-creds" "key" "password") | indent 14 }}
jananib28734e02020-04-08 21:35:45 +053067 envFrom:
68 - configMapRef:
69 name: {{ include "common.fullname" . }}-env
70 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010071 volumeMounts:
jananib28734e02020-04-08 21:35:45 +053072 - name: logs
73 mountPath: /app/logs
74 - name: config
75 mountPath: /app/config
76 readOnly: true
jananib28734e02020-04-08 21:35:45 +053077 livenessProbe:
78 httpGet:
79 path: {{ index .Values.livenessProbe.path}}
80 port: {{ index .Values.containerPort }}
81 scheme: {{ index .Values.livenessProbe.scheme}}
82 initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}}
83 periodSeconds: {{ index .Values.livenessProbe.periodSeconds}}
84 timeoutSeconds: {{ index .Values.livenessProbe.timeoutSeconds}}
85 successThreshold: {{ index .Values.livenessProbe.successThreshold}}
86 failureThreshold: {{ index .Values.livenessProbe.failureThreshold}}
farida azmy87f46222021-04-06 15:25:15 +020087 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Andreas Geisslerad61ccf2023-02-23 09:17:36 +010088 volumes:
jananib28734e02020-04-08 21:35:45 +053089 - name: logs
90 emptyDir: {}
91 - name: config
92 configMap:
93 name: {{ include "common.fullname" . }}
jananib28734e02020-04-08 21:35:45 +053094 imagePullSecrets:
95 - name: "{{ include "common.namespace" . }}-docker-registry-key"