blob: b188cdae98de013c118d33c672b702874ed98d62 [file] [log] [blame]
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00001# Copyright © 2017 Amdocs, AT&T, Bell Canada
2# Modifications Copyright © 2018 ZTE
priyanshua1b061392018-05-29 12:50:14 +05303#
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.
15
kwasiel59cc6a42020-07-23 10:02:49 +000016apiVersion: apps/v1
priyanshua1b061392018-05-29 12:50:14 +053017kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
priyanshua1b061392018-05-29 12:50:14 +053025 heritage: {{ .Release.Service }}
26spec:
kwasiel59cc6a42020-07-23 10:02:49 +000027 selector:
28 matchLabels:
29 app: {{ include "common.name" . }}
priyanshua1b061392018-05-29 12:50:14 +053030 replicas: {{ .Values.replicaCount }}
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010035 release: {{ include "common.release" . }}
priyanshua1b061392018-05-29 12:50:14 +053036 spec:
ChrisC742a7b22020-09-04 11:29:57 +020037 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
priyanshu617e90b2019-03-14 12:56:55 +053038 {{- if .Values.initJob.enabled }}
priyanshua1b061392018-05-29 12:50:14 +053039 - name: {{ include "common.name" . }}-job-completion
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020040 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
priyanshua1b061392018-05-29 12:50:14 +053041 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
42 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020043 - /app/ready.py
priyanshua1b061392018-05-29 12:50:14 +053044 args:
45 - --job-name
priyanshu3af9db62018-08-16 16:23:52 +053046 - {{ include "common.fullname" . }}-workflow-init
priyanshua1b061392018-05-29 12:50:14 +053047 env:
48 - name: NAMESPACE
49 valueFrom:
50 fieldRef:
51 apiVersion: v1
52 fieldPath: metadata.namespace
priyanshu9be63472019-03-13 14:43:36 +053053 {{ end }}
priyanshua1b061392018-05-29 12:50:14 +053054 containers:
55 - name: {{ include "common.name" . }}
56 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
57 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ChrisC742a7b22020-09-04 11:29:57 +020058 {{- if .Values.global.aafEnabled }}
59 command:
60 - sh
61 args:
62 - "-c"
63 - |
64 export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
65 export SERVER_SSL_KEY_PASSWORD=$cadi_keystore_password_p12
66 export KEYMANAGER_PASS=$cadi_keystore_password_p12
67 export SERVER_SSL_TRUST_PASSWORD=$cadi_truststore_password
68 export SERVER_SSL_KEYSTORE_PATH={{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }}
69 export SERVER_SSL_TRUSTSTORE_PATH={{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }}
70 ./startup.sh
71 {{- end }}
priyanshua1b061392018-05-29 12:50:14 +053072 ports:
IlanaPc80bff92019-11-18 21:10:08 +020073 - containerPort: {{ template "wfd-be.internalPort" . }}
priyanshua1b061392018-05-29 12:50:14 +053074 # disable liveness probe when breakpoints set in debugger
75 # so K8s doesn't restart unresponsive container
76 {{ if .Values.liveness.enabled }}
77 livenessProbe:
78 tcpSocket:
IlanaPc80bff92019-11-18 21:10:08 +020079 port: {{ template "wfd-be.internalPort" . }}
priyanshua1b061392018-05-29 12:50:14 +053080 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
81 periodSeconds: {{ .Values.liveness.periodSeconds }}
82 {{ end }}
83 readinessProbe:
84 tcpSocket:
IlanaPc80bff92019-11-18 21:10:08 +020085 port: {{ template "wfd-be.internalPort" . }}
priyanshua1b061392018-05-29 12:50:14 +053086 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
87 periodSeconds: {{ .Values.readiness.periodSeconds }}
88 env:
89 - name: JAVA_OPTIONS
90 value: {{ .Values.config.javaOptions }}
priyanshu3af9db62018-08-16 16:23:52 +053091 - name: CS_HOSTS
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +000092 value: "{{ .Values.global.cassandra.serviceName }}"
priyanshu3af9db62018-08-16 16:23:52 +053093 - name: CS_PORT
94 value: "{{ .Values.config.cassandraClientPort }}"
priyanshubd7fbe22019-03-20 12:45:21 +053095 - name: CS_AUTHENTICATE
96 value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
priyanshu3af9db62018-08-16 16:23:52 +053097 - name: CS_USER
98 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010099 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
priyanshu3af9db62018-08-16 16:23:52 +0530100 - name: CS_PASSWORD
101 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100102 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
priyanshubd7fbe22019-03-20 12:45:21 +0530103 - name: CS_SSL_ENABLED
104 value: "{{ .Values.config.cassandraSSLEnabled }}"
105 - name: CS_TRUST_STORE_PATH
106 value: "{{ .Values.config.cassandraTrustStorePath }}"
107 - name: CS_TRUST_STORE_PASSWORD
IlanaPc80bff92019-11-18 21:10:08 +0200108 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100109 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_truststore_password}
priyanshu3af9db62018-08-16 16:23:52 +0530110 - name: SDC_PROTOCOL
111 value: "{{ .Values.config.sdcProtocol }}"
112 - name: SDC_ENDPOINT
113 value: "{{ .Values.config.sdcEndpoint }}"
priyanshuc00acbb2018-09-06 11:29:23 +0530114 - name: SDC_USER
115 value: "{{ .Values.config.sdcExternalUser }}"
116 - name: SDC_PASSWORD
IlanaPc80bff92019-11-18 21:10:08 +0200117 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100118 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: wf_external_user_password}
priyanshubd7fbe22019-03-20 12:45:21 +0530119 - name: SERVER_SSL_ENABLED
120 value: "{{ .Values.config.serverSSLEnabled }}"
121 - name: SERVER_SSL_KEYSTORE_TYPE
priyanshu5698c832019-03-26 18:02:33 +0530122 value: "{{ .Values.config.serverSSLKeyStoreType }}"
IlanaPc80bff92019-11-18 21:10:08 +0200123 - name: SERVER_SSL_TRUSTSTORE_TYPE
124 value: "{{ .Values.config.serverSSLTrustStoreType }}"
ChrisC742a7b22020-09-04 11:29:57 +0200125 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
126 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
priyanshua1b061392018-05-29 12:50:14 +0530127 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000128 - name: "{{ include "common.namespace" . }}-docker-registry-key"