blob: bb96d342f7cd8b75f2ed5086b1d875d637af8d69 [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
16apiVersion: extensions/v1beta1
17kind: 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 "+" "_" }}
24 release: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
32 release: {{ .Release.Name }}
33 spec:
34 initContainers:
priyanshu617e90b2019-03-14 12:56:55 +053035 {{- if .Values.initJob.enabled }}
priyanshua1b061392018-05-29 12:50:14 +053036 - name: {{ include "common.name" . }}-job-completion
37 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
38 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
39 command:
40 - /root/job_complete.py
41 args:
42 - --job-name
priyanshu3af9db62018-08-16 16:23:52 +053043 - {{ include "common.fullname" . }}-workflow-init
priyanshua1b061392018-05-29 12:50:14 +053044 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
priyanshu9be63472019-03-13 14:43:36 +053050 {{ end }}
priyanshua1b061392018-05-29 12:50:14 +053051 containers:
52 - name: {{ include "common.name" . }}
53 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 ports:
56 - containerPort: {{ .Values.service.internalPort }}
priyanshubd7fbe22019-03-20 12:45:21 +053057 - containerPort: {{ .Values.service.internalPort2 }}
priyanshua1b061392018-05-29 12:50:14 +053058 # disable liveness probe when breakpoints set in debugger
59 # so K8s doesn't restart unresponsive container
60 {{ if .Values.liveness.enabled }}
61 livenessProbe:
62 tcpSocket:
63 port: {{ .Values.service.internalPort }}
64 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
65 periodSeconds: {{ .Values.liveness.periodSeconds }}
66 {{ end }}
67 readinessProbe:
68 tcpSocket:
69 port: {{ .Values.service.internalPort }}
70 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
71 periodSeconds: {{ .Values.readiness.periodSeconds }}
72 env:
73 - name: JAVA_OPTIONS
74 value: {{ .Values.config.javaOptions }}
priyanshu3af9db62018-08-16 16:23:52 +053075 - name: CS_HOSTS
76 value: "{{ .Values.config.cassandraHosts }}"
77 - name: CS_PORT
78 value: "{{ .Values.config.cassandraClientPort }}"
priyanshubd7fbe22019-03-20 12:45:21 +053079 - name: CS_AUTHENTICATE
80 value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
priyanshu3af9db62018-08-16 16:23:52 +053081 - name: CS_USER
82 valueFrom:
83 secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_user}
84 - name: CS_PASSWORD
85 valueFrom:
86 secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_password}
priyanshubd7fbe22019-03-20 12:45:21 +053087 - name: CS_SSL_ENABLED
88 value: "{{ .Values.config.cassandraSSLEnabled }}"
89 - name: CS_TRUST_STORE_PATH
90 value: "{{ .Values.config.cassandraTrustStorePath }}"
91 - name: CS_TRUST_STORE_PASSWORD
92 value: "{{ .Values.config.cassandraTrustStorePassword }}"
priyanshu3af9db62018-08-16 16:23:52 +053093 - name: SDC_PROTOCOL
94 value: "{{ .Values.config.sdcProtocol }}"
95 - name: SDC_ENDPOINT
96 value: "{{ .Values.config.sdcEndpoint }}"
priyanshuc00acbb2018-09-06 11:29:23 +053097 - name: SDC_USER
98 value: "{{ .Values.config.sdcExternalUser }}"
99 - name: SDC_PASSWORD
100 value: "{{ .Values.config.sdcExternalUserPassword }}"
priyanshubd7fbe22019-03-20 12:45:21 +0530101 - name: SERVER_SSL_ENABLED
102 value: "{{ .Values.config.serverSSLEnabled }}"
103 - name: SERVER_SSL_KEYSTORE_TYPE
priyanshu5698c832019-03-26 18:02:33 +0530104 value: "{{ .Values.config.serverSSLKeyStoreType }}"
priyanshubd7fbe22019-03-20 12:45:21 +0530105 - name: SERVER_SSL_KEYSTORE_PATH
106 value: "{{ .Values.config.serverSSLKeyStorePath }}"
107 - name: SERVER_SSL_KEY_PASSWORD
108 value: "{{ .Values.config.serverSSLKeyPassword }}"
109 volumeMounts:
priyanshu5698c832019-03-26 18:02:33 +0530110 {{- template "sdc-wfd-be.volumeMounts" . }}
priyanshubd7fbe22019-03-20 12:45:21 +0530111 volumes:
priyanshu5698c832019-03-26 18:02:33 +0530112 {{- template "sdc-wfd-be.volumes" . }}
priyanshua1b061392018-05-29 12:50:14 +0530113 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000114 - name: "{{ include "common.namespace" . }}-docker-registry-key"