Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, AT&T, Bell Canada |
| 3 | # Modifications Copyright © 2018 ZTE |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 17 | |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 18 | apiVersion: apps/v1 |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 19 | kind: Deployment |
| 20 | metadata: |
| 21 | name: {{ include "common.fullname" . }} |
| 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
| 24 | app: {{ include "common.name" . }} |
| 25 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 26 | release: {{ include "common.release" . }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 27 | heritage: {{ .Release.Service }} |
| 28 | spec: |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 32 | replicas: {{ .Values.replicaCount }} |
| 33 | template: |
| 34 | metadata: |
| 35 | labels: |
| 36 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 37 | release: {{ include "common.release" . }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 38 | spec: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 39 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
priyanshu | 617e90b | 2019-03-14 12:56:55 +0530 | [diff] [blame] | 40 | {{- if .Values.initJob.enabled }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 41 | - name: {{ include "common.name" . }}-job-completion |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 42 | image: {{ include "repositoryGenerator.image.readiness" . }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 43 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 44 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 45 | - /app/ready.py |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 46 | args: |
| 47 | - --job-name |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 48 | - {{ include "common.fullname" . }}-workflow-init |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 49 | env: |
| 50 | - name: NAMESPACE |
| 51 | valueFrom: |
| 52 | fieldRef: |
| 53 | apiVersion: v1 |
| 54 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 55 | resources: |
| 56 | limits: |
| 57 | cpu: 100m |
| 58 | memory: 100Mi |
| 59 | requests: |
| 60 | cpu: 3m |
| 61 | memory: 20Mi |
priyanshu | 9be6347 | 2019-03-13 14:43:36 +0530 | [diff] [blame] | 62 | {{ end }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 63 | containers: |
| 64 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 65 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 67 | {{- if .Values.global.aafEnabled }} |
| 68 | command: |
| 69 | - sh |
| 70 | args: |
| 71 | - "-c" |
| 72 | - | |
| 73 | export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 74 | export SERVER_SSL_KEY_PASSWORD=$cadi_keystore_password_p12 |
| 75 | export KEYMANAGER_PASS=$cadi_keystore_password_p12 |
| 76 | export SERVER_SSL_TRUST_PASSWORD=$cadi_truststore_password |
| 77 | export SERVER_SSL_KEYSTORE_PATH={{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} |
| 78 | export SERVER_SSL_TRUSTSTORE_PATH={{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} |
| 79 | ./startup.sh |
| 80 | {{- end }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 81 | ports: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 82 | - containerPort: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort2 .Values.service.internalPort }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 83 | # disable liveness probe when breakpoints set in debugger |
| 84 | # so K8s doesn't restart unresponsive container |
| 85 | {{ if .Values.liveness.enabled }} |
| 86 | livenessProbe: |
| 87 | tcpSocket: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 88 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort2 .Values.service.internalPort }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 89 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 90 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 91 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 92 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 93 | {{ end }} |
| 94 | readinessProbe: |
| 95 | tcpSocket: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 96 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort2 .Values.service.internalPort }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 97 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 98 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 99 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 100 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
| 101 | startupProbe: |
| 102 | tcpSocket: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 103 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort2 .Values.service.internalPort }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 104 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 105 | periodSeconds: {{ .Values.startup.periodSeconds }} |
| 106 | successThreshold: {{ .Values.startup.successThreshold }} |
| 107 | failureThreshold: {{ .Values.startup.failureThreshold }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 108 | env: |
| 109 | - name: JAVA_OPTIONS |
| 110 | value: {{ .Values.config.javaOptions }} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 111 | - name: CS_HOSTS |
Andreas Geissler | fd450c4 | 2021-12-10 08:36:45 +0000 | [diff] [blame] | 112 | value: "{{ .Values.global.sdc_cassandra.serviceName }}" |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 113 | - name: CS_PORT |
| 114 | value: "{{ .Values.config.cassandraClientPort }}" |
priyanshu | bd7fbe2 | 2019-03-20 12:45:21 +0530 | [diff] [blame] | 115 | - name: CS_AUTHENTICATE |
| 116 | value: "{{ .Values.config.cassandraAuthenticationEnabled }}" |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 117 | - name: CS_USER |
| 118 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 119 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 120 | - name: CS_PASSWORD |
| 121 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 122 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password} |
priyanshu | bd7fbe2 | 2019-03-20 12:45:21 +0530 | [diff] [blame] | 123 | - name: CS_SSL_ENABLED |
| 124 | value: "{{ .Values.config.cassandraSSLEnabled }}" |
| 125 | - name: CS_TRUST_STORE_PATH |
| 126 | value: "{{ .Values.config.cassandraTrustStorePath }}" |
| 127 | - name: CS_TRUST_STORE_PASSWORD |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 128 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 129 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_truststore_password} |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 130 | - name: SDC_PROTOCOL |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 131 | value: "{{ (eq "true" (include "common.needTLS" .)) | ternary "HTTPS" "HTTP" }}" |
priyanshu | 3af9db6 | 2018-08-16 16:23:52 +0530 | [diff] [blame] | 132 | - name: SDC_ENDPOINT |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 133 | value: "{{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.sdcEndpoint.https .Values.config.sdcEndpoint.http }}" |
priyanshu | c00acbb | 2018-09-06 11:29:23 +0530 | [diff] [blame] | 134 | - name: SDC_USER |
| 135 | value: "{{ .Values.config.sdcExternalUser }}" |
| 136 | - name: SDC_PASSWORD |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 137 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 138 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: wf_external_user_password} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 139 | {{- if (include "common.needTLS" .) }} |
priyanshu | bd7fbe2 | 2019-03-20 12:45:21 +0530 | [diff] [blame] | 140 | - name: SERVER_SSL_ENABLED |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 141 | value: "true" |
priyanshu | bd7fbe2 | 2019-03-20 12:45:21 +0530 | [diff] [blame] | 142 | - name: SERVER_SSL_KEYSTORE_TYPE |
priyanshu | 5698c83 | 2019-03-26 18:02:33 +0530 | [diff] [blame] | 143 | value: "{{ .Values.config.serverSSLKeyStoreType }}" |
IlanaP | c80bff9 | 2019-11-18 21:10:08 +0200 | [diff] [blame] | 144 | - name: SERVER_SSL_TRUSTSTORE_TYPE |
| 145 | value: "{{ .Values.config.serverSSLTrustStoreType }}" |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 146 | {{- else }} |
| 147 | - name: SERVER_SSL_ENABLED |
| 148 | value: "false" |
| 149 | {{- end }} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 150 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 151 | resources: {{ include "common.resources" . | nindent 12 }} |
farida azmy | 1383b4c | 2021-04-06 12:33:31 +0200 | [diff] [blame] | 152 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 153 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
priyanshua | 1b06139 | 2018-05-29 12:50:14 +0530 | [diff] [blame] | 154 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 155 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |