blob: e58ffe87a09c9bcc9f4295c5b4bc4cf7c5d3abf3 [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 Desbureaux1694e1d2020-08-21 09:58:25 +020042 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
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" . }}
65 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
66 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:
IlanaPc80bff92019-11-18 21:10:08 +020082 - containerPort: {{ template "wfd-be.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:
IlanaPc80bff92019-11-18 21:10:08 +020088 port: {{ template "wfd-be.internalPort" . }}
priyanshua1b061392018-05-29 12:50:14 +053089 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
90 periodSeconds: {{ .Values.liveness.periodSeconds }}
91 {{ end }}
92 readinessProbe:
93 tcpSocket:
IlanaPc80bff92019-11-18 21:10:08 +020094 port: {{ template "wfd-be.internalPort" . }}
priyanshua1b061392018-05-29 12:50:14 +053095 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
96 periodSeconds: {{ .Values.readiness.periodSeconds }}
97 env:
98 - name: JAVA_OPTIONS
99 value: {{ .Values.config.javaOptions }}
priyanshu3af9db62018-08-16 16:23:52 +0530100 - name: CS_HOSTS
Mahendra Raghuwanshi35f83f52019-03-20 10:42:49 +0000101 value: "{{ .Values.global.cassandra.serviceName }}"
priyanshu3af9db62018-08-16 16:23:52 +0530102 - name: CS_PORT
103 value: "{{ .Values.config.cassandraClientPort }}"
priyanshubd7fbe22019-03-20 12:45:21 +0530104 - name: CS_AUTHENTICATE
105 value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
priyanshu3af9db62018-08-16 16:23:52 +0530106 - name: CS_USER
107 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100108 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
priyanshu3af9db62018-08-16 16:23:52 +0530109 - name: CS_PASSWORD
110 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100111 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
priyanshubd7fbe22019-03-20 12:45:21 +0530112 - name: CS_SSL_ENABLED
113 value: "{{ .Values.config.cassandraSSLEnabled }}"
114 - name: CS_TRUST_STORE_PATH
115 value: "{{ .Values.config.cassandraTrustStorePath }}"
116 - name: CS_TRUST_STORE_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: cs_truststore_password}
priyanshu3af9db62018-08-16 16:23:52 +0530119 - name: SDC_PROTOCOL
120 value: "{{ .Values.config.sdcProtocol }}"
121 - name: SDC_ENDPOINT
122 value: "{{ .Values.config.sdcEndpoint }}"
priyanshuc00acbb2018-09-06 11:29:23 +0530123 - name: SDC_USER
124 value: "{{ .Values.config.sdcExternalUser }}"
125 - name: SDC_PASSWORD
IlanaPc80bff92019-11-18 21:10:08 +0200126 valueFrom:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100127 secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: wf_external_user_password}
priyanshubd7fbe22019-03-20 12:45:21 +0530128 - name: SERVER_SSL_ENABLED
129 value: "{{ .Values.config.serverSSLEnabled }}"
130 - name: SERVER_SSL_KEYSTORE_TYPE
priyanshu5698c832019-03-26 18:02:33 +0530131 value: "{{ .Values.config.serverSSLKeyStoreType }}"
IlanaPc80bff92019-11-18 21:10:08 +0200132 - name: SERVER_SSL_TRUSTSTORE_TYPE
133 value: "{{ .Values.config.serverSSLTrustStoreType }}"
ChrisC742a7b22020-09-04 11:29:57 +0200134 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
ChrisC32172342020-10-02 16:39:13 +0200135 resources: {{ include "common.resources" . | nindent 12 }}
ChrisC742a7b22020-09-04 11:29:57 +0200136 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
priyanshua1b061392018-05-29 12:50:14 +0530137 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000138 - name: "{{ include "common.namespace" . }}-docker-registry-key"