blob: a187e19a75449e9a4d1585432831a2fc2ed18f3e [file] [log] [blame]
Jakub Latusekd8eaff62020-10-21 13:36:29 +02001{{/*
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Copyright © 2017 Amdocs, AT&T, Bell Canada
3# Modifications Copyright © 2018 ZTE
priyanshua1b061392018-05-29 12:50:14 +05304#
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 Latusekd8eaff62020-10-21 13:36:29 +020016*/}}
priyanshua1b061392018-05-29 12:50:14 +053017
kwasiel59cc6a42020-07-23 10:02:49 +000018apiVersion: apps/v1
priyanshua1b061392018-05-29 12:50:14 +053019kind: Deployment
20metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
priyanshua1b061392018-05-29 12:50:14 +053027 heritage: {{ .Release.Service }}
28spec:
kwasiel59cc6a42020-07-23 10:02:49 +000029 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
priyanshua1b061392018-05-29 12:50:14 +053032 replicas: {{ .Values.replicaCount }}
33 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
priyanshua1b061392018-05-29 12:50:14 +053038 spec:
ChrisC742a7b22020-09-04 11:29:57 +020039 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
priyanshu617e90b2019-03-14 12:56:55 +053040 {{- if .Values.initJob.enabled }}
priyanshua1b061392018-05-29 12:50:14 +053041 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010042 image: {{ include "repositoryGenerator.image.readiness" . }}
priyanshua1b061392018-05-29 12:50:14 +053043 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
44 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020045 - /app/ready.py
priyanshua1b061392018-05-29 12:50:14 +053046 args:
47 - --job-name
priyanshu3af9db62018-08-16 16:23:52 +053048 - {{ include "common.fullname" . }}-workflow-init
priyanshua1b061392018-05-29 12:50:14 +053049 env:
50 - name: NAMESPACE
51 valueFrom:
52 fieldRef:
53 apiVersion: v1
54 fieldPath: metadata.namespace
ChrisC32172342020-10-02 16:39:13 +020055 resources:
56 limits:
57 cpu: 100m
58 memory: 100Mi
59 requests:
60 cpu: 3m
61 memory: 20Mi
priyanshu9be63472019-03-13 14:43:36 +053062 {{ end }}
priyanshua1b061392018-05-29 12:50:14 +053063 containers:
64 - name: {{ include "common.name" . }}
Sylvain Desbureaux0a1eaf32020-11-19 17:56:08 +010065 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
priyanshua1b061392018-05-29 12:50:14 +053066 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ChrisC742a7b22020-09-04 11:29:57 +020067 {{- 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 }}
priyanshua1b061392018-05-29 12:50:14 +053081 ports:
othman touijer2b764d02022-01-05 14:40:37 +010082 - containerPort: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort2 .Values.service.internalPort }}
priyanshua1b061392018-05-29 12:50:14 +053083 # 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 touijer2b764d02022-01-05 14:40:37 +010088 port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort2 .Values.service.internalPort }}
priyanshua1b061392018-05-29 12:50:14 +053089 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
90 periodSeconds: {{ .Values.liveness.periodSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +020091 successThreshold: {{ .Values.liveness.successThreshold }}
92 failureThreshold: {{ .Values.liveness.failureThreshold }}
priyanshua1b061392018-05-29 12:50:14 +053093 {{ end }}
94 readinessProbe:
95 tcpSocket:
othman touijer2b764d02022-01-05 14:40:37 +010096 port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort2 .Values.service.internalPort }}
priyanshua1b061392018-05-29 12:50:14 +053097 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
98 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +020099 successThreshold: {{ .Values.readiness.successThreshold }}
100 failureThreshold: {{ .Values.readiness.failureThreshold }}
101 startupProbe:
102 tcpSocket:
othman touijer2b764d02022-01-05 14:40:37 +0100103 port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort2 .Values.service.internalPort }}
Sylvain Desbureaux8c9416b2021-05-05 11:12:48 +0200104 initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
105 periodSeconds: {{ .Values.startup.periodSeconds }}
106 successThreshold: {{ .Values.startup.successThreshold }}
107 failureThreshold: {{ .Values.startup.failureThreshold }}
priyanshua1b061392018-05-29 12:50:14 +0530108 env:
109 - name: JAVA_OPTIONS
110 value: {{ .Values.config.javaOptions }}
priyanshu3af9db62018-08-16 16:23:52 +0530111 - name: CS_HOSTS
Andreas Geisslerfd450c42021-12-10 08:36:45 +0000112 value: "{{ .Values.global.sdc_cassandra.serviceName }}"
priyanshu3af9db62018-08-16 16:23:52 +0530113 - name: CS_PORT
114 value: "{{ .Values.config.cassandraClientPort }}"
priyanshubd7fbe22019-03-20 12:45:21 +0530115 - name: CS_AUTHENTICATE
116 value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
priyanshu3af9db62018-08-16 16:23:52 +0530117 - name: CS_USER
118 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100119 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
priyanshu3af9db62018-08-16 16:23:52 +0530120 - name: CS_PASSWORD
121 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100122 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
priyanshubd7fbe22019-03-20 12:45:21 +0530123 - 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
IlanaPc80bff92019-11-18 21:10:08 +0200128 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100129 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_truststore_password}
priyanshu3af9db62018-08-16 16:23:52 +0530130 - name: SDC_PROTOCOL
othman touijer2b764d02022-01-05 14:40:37 +0100131 value: "{{ (eq "true" (include "common.needTLS" .)) | ternary "HTTPS" "HTTP" }}"
priyanshu3af9db62018-08-16 16:23:52 +0530132 - name: SDC_ENDPOINT
othman touijer2b764d02022-01-05 14:40:37 +0100133 value: "{{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.sdcEndpoint.https .Values.config.sdcEndpoint.http }}"
priyanshuc00acbb2018-09-06 11:29:23 +0530134 - name: SDC_USER
135 value: "{{ .Values.config.sdcExternalUser }}"
136 - name: SDC_PASSWORD
IlanaPc80bff92019-11-18 21:10:08 +0200137 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100138 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: wf_external_user_password}
othman touijer2b764d02022-01-05 14:40:37 +0100139 {{- if (include "common.needTLS" .) }}
priyanshubd7fbe22019-03-20 12:45:21 +0530140 - name: SERVER_SSL_ENABLED
othman touijer2b764d02022-01-05 14:40:37 +0100141 value: "true"
priyanshubd7fbe22019-03-20 12:45:21 +0530142 - name: SERVER_SSL_KEYSTORE_TYPE
priyanshu5698c832019-03-26 18:02:33 +0530143 value: "{{ .Values.config.serverSSLKeyStoreType }}"
IlanaPc80bff92019-11-18 21:10:08 +0200144 - name: SERVER_SSL_TRUSTSTORE_TYPE
145 value: "{{ .Values.config.serverSSLTrustStoreType }}"
othman touijer2b764d02022-01-05 14:40:37 +0100146 {{- else }}
147 - name: SERVER_SSL_ENABLED
148 value: "false"
149 {{- end }}
ChrisC742a7b22020-09-04 11:29:57 +0200150 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
ChrisC32172342020-10-02 16:39:13 +0200151 resources: {{ include "common.resources" . | nindent 12 }}
farida azmy1383b4c2021-04-06 12:33:31 +0200152 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
ChrisC742a7b22020-09-04 11:29:57 +0200153 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
priyanshua1b061392018-05-29 12:50:14 +0530154 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000155 - name: "{{ include "common.namespace" . }}-docker-registry-key"