Jakub Latusek | 44f0fdd | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 2 | # 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 Latusek | 44f0fdd | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 16 | apiVersion: apps/v1 |
| 17 | kind: Deployment |
| 18 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 19 | spec: |
| 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 Desbureaux | d055a17 | 2020-10-30 14:32:03 +0100 | [diff] [blame] | 32 | initContainers: |
| 33 | {{ include "so.certificate.container_importer" . | indent 6 | trim }} |
| 34 | {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 35 | containers: |
| 36 | - name: {{ include "common.name" . }} |
| 37 | command: |
| 38 | - sh |
| 39 | args: |
| 40 | - -c |
seshukm | 0df1f8e | 2020-08-17 21:45:49 +0530 | [diff] [blame] | 41 | - | |
| 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 }} |
Sylvain Desbureaux | fde9407 | 2021-03-19 15:06:41 +0100 | [diff] [blame] | 45 | export $(cat {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
seshukm | 0df1f8e | 2020-08-17 21:45:49 +0530 | [diff] [blame] | 46 | {{- if .Values.global.security.aaf.enabled }} |
Sylvain Desbureaux | a1bbe5c | 2020-10-28 16:55:18 +0100 | [diff] [blame] | 47 | export KEYSTORE_PASSWORD="${cadi_keystore_password_p12}" |
seshukm | 0df1f8e | 2020-08-17 21:45:49 +0530 | [diff] [blame] | 48 | {{- end }} |
| 49 | {{- end }} |
| 50 | ./start-app.sh |
Sylvain Desbureaux | 747982c | 2020-11-19 17:40:05 +0100 | [diff] [blame] | 51 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 52 | resources: {{ include "common.resources" . | nindent 12 }} |
| 53 | ports: {{- include "common.containerPorts" . | nindent 12 }} |
| 54 | env: |
| 55 | - name: DB_HOST |
krishnaa96 | 92b606b | 2020-10-30 11:29:21 +0530 | [diff] [blame] | 56 | value: {{ include "common.mariadbService" . }} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 57 | - name: DB_PORT |
krishnaa96 | 92b606b | 2020-10-30 11:29:21 +0530 | [diff] [blame] | 58 | value: {{ include "common.mariadbPort" . | quote }} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 59 | - name: DB_USERNAME |
| 60 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }} |
| 61 | - name: DB_PASSWORD |
| 62 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }} |
| 63 | - name: DB_ADMIN_USERNAME |
| 64 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }} |
| 65 | - name: DB_ADMIN_PASSWORD |
| 66 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 67 | - name: BPEL_USERNAME |
| 68 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-bpel-creds" "key" "login") | indent 14 }} |
| 69 | - name: BPEL_PASSWORD_INPUT |
| 70 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-bpel-creds" "key" "password") | indent 14 }} |
| 71 | - name: ACTUATOR_USERNAME |
| 72 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-actuator-creds" "key" "login") | indent 14 }} |
| 73 | - name: ACTUATOR_PASSWORD_INPUT |
| 74 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "server-actuator-creds" "key" "password") | indent 14 }} |
Krzysztof Opasiak | 098ff42 | 2020-10-21 13:06:52 +0200 | [diff] [blame] | 75 | {{ include "so.certificates.env" . | nindent 12 }} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 76 | envFrom: |
| 77 | - configMapRef: |
| 78 | name: {{ include "common.fullname" . }}-env |
| 79 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
seshukm | 0df1f8e | 2020-08-17 21:45:49 +0530 | [diff] [blame] | 80 | volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 12 }} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 81 | - name: logs |
| 82 | mountPath: /app/logs |
| 83 | - name: config |
| 84 | mountPath: /app/config |
| 85 | readOnly: true |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 86 | livenessProbe: |
| 87 | httpGet: |
| 88 | path: {{ index .Values.livenessProbe.path}} |
| 89 | port: {{ index .Values.containerPort }} |
| 90 | scheme: {{ index .Values.livenessProbe.scheme}} |
| 91 | initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}} |
| 92 | periodSeconds: {{ index .Values.livenessProbe.periodSeconds}} |
| 93 | timeoutSeconds: {{ index .Values.livenessProbe.timeoutSeconds}} |
| 94 | successThreshold: {{ index .Values.livenessProbe.successThreshold}} |
| 95 | failureThreshold: {{ index .Values.livenessProbe.failureThreshold}} |
| 96 | volumes: {{ include "so.certificate.volumes" . | nindent 8 }} |
| 97 | - name: logs |
| 98 | emptyDir: {} |
| 99 | - name: config |
| 100 | configMap: |
| 101 | name: {{ include "common.fullname" . }} |
jananib | 28734e0 | 2020-04-08 21:35:45 +0530 | [diff] [blame] | 102 | imagePullSecrets: |
| 103 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |