blob: c213319714bc1e9029aa8ab9a91a2ca130b4d918 [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:
32 initContainers: {{ include "so.certificate.container_importer" . | nindent 8 }}
33 - name: {{ include "common.name" . }}-readiness
34 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020035 - /app/ready.py
jananib28734e02020-04-08 21:35:45 +053036 args:
37 - --job-name
38 - {{ include "common.release" . }}-so-mariadb-config-job
39 env:
40 - name: NAMESPACE
41 valueFrom:
42 fieldRef:
43 apiVersion: v1
44 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020045 image: {{ include "common.repository" . }}/{{ .Values.global.readinessImage }}
jananib28734e02020-04-08 21:35:45 +053046 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47 containers:
48 - name: {{ include "common.name" . }}
49 command:
50 - sh
51 args:
52 - -c
seshukm0df1f8e2020-08-17 21:45:49 +053053 - |
54 export BPEL_PASSWORD=`htpasswd -bnBC 10 "" $BPEL_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'`
55 export ACTUATOR_PASSWORD=`htpasswd -bnBC 10 "" $ACTUATOR_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'`
56 {{- if .Values.global.aafEnabled }}
57 export $(grep '^c' {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0)
58 export TRUSTSTORE_PASSWORD="${cadi_truststore_password}"
59 {{- if .Values.global.security.aaf.enabled }}
Sylvain Desbureauxa1bbe5c2020-10-28 16:55:18 +010060 export KEYSTORE_PASSWORD="${cadi_keystore_password_p12}"
seshukm0df1f8e2020-08-17 21:45:49 +053061 {{- end }}
62 {{- end }}
63 ./start-app.sh
jananib28734e02020-04-08 21:35:45 +053064 image: {{ include "common.repository" . }}/{{ .Values.image }}
65 resources: {{ include "common.resources" . | nindent 12 }}
66 ports: {{- include "common.containerPorts" . | nindent 12 }}
67 env:
68 - name: DB_HOST
krishnaa9692b606b2020-10-30 11:29:21 +053069 value: {{ include "common.mariadbService" . }}
jananib28734e02020-04-08 21:35:45 +053070 - name: DB_PORT
krishnaa9692b606b2020-10-30 11:29:21 +053071 value: {{ include "common.mariadbPort" . | quote }}
jananib28734e02020-04-08 21:35:45 +053072 - name: DB_USERNAME
73 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }}
74 - name: DB_PASSWORD
75 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }}
76 - name: DB_ADMIN_USERNAME
77 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }}
78 - name: DB_ADMIN_PASSWORD
79 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }}
jananib28734e02020-04-08 21:35:45 +053080 - name: BPEL_USERNAME
81 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-bpel-creds" "key" "login") | indent 14 }}
82 - name: BPEL_PASSWORD_INPUT
83 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-bpel-creds" "key" "password") | indent 14 }}
84 - name: ACTUATOR_USERNAME
85 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-actuator-creds" "key" "login") | indent 14 }}
86 - name: ACTUATOR_PASSWORD_INPUT
87 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-actuator-creds" "key" "password") | indent 14 }}
Krzysztof Opasiak098ff422020-10-21 13:06:52 +020088 {{ include "so.certificates.env" . | nindent 12 }}
jananib28734e02020-04-08 21:35:45 +053089 envFrom:
90 - configMapRef:
91 name: {{ include "common.fullname" . }}-env
92 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
seshukm0df1f8e2020-08-17 21:45:49 +053093 volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 12 }}
jananib28734e02020-04-08 21:35:45 +053094 - name: logs
95 mountPath: /app/logs
96 - name: config
97 mountPath: /app/config
98 readOnly: true
jananib28734e02020-04-08 21:35:45 +053099 livenessProbe:
100 httpGet:
101 path: {{ index .Values.livenessProbe.path}}
102 port: {{ index .Values.containerPort }}
103 scheme: {{ index .Values.livenessProbe.scheme}}
104 initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}}
105 periodSeconds: {{ index .Values.livenessProbe.periodSeconds}}
106 timeoutSeconds: {{ index .Values.livenessProbe.timeoutSeconds}}
107 successThreshold: {{ index .Values.livenessProbe.successThreshold}}
108 failureThreshold: {{ index .Values.livenessProbe.failureThreshold}}
109 volumes: {{ include "so.certificate.volumes" . | nindent 8 }}
110 - name: logs
111 emptyDir: {}
112 - name: config
113 configMap:
114 name: {{ include "common.fullname" . }}
jananib28734e02020-04-08 21:35:45 +0530115 imagePullSecrets:
116 - name: "{{ include "common.namespace" . }}-docker-registry-key"