[SDC] Add missing dependency to cassandra chart
[oom.git] / kubernetes / sdc / components / sdc-wfd-be / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, AT&T, Bell Canada
3 # Modifications Copyright © 2018  ZTE
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.
16 */}}
17
18 apiVersion: apps/v1
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 "+" "_" }}
26     release: {{ include "common.release" . }}
27     heritage: {{ .Release.Service }}
28 spec:
29   selector:
30     matchLabels:
31       app: {{ include "common.name" . }}
32   replicas: {{ .Values.replicaCount }}
33   template:
34     metadata:
35       labels:
36         app: {{ include "common.name" . }}
37         release: {{ include "common.release" . }}
38     spec:
39       initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
40       {{- if .Values.initJob.enabled }}
41       - name: {{ include "common.name" . }}-job-completion
42         image: {{ include "repositoryGenerator.image.readiness" . }}
43         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
44         command:
45         - /app/ready.py
46         args:
47         - --job-name
48         - {{ include "common.fullname" . }}-workflow-init
49         env:
50         - name: NAMESPACE
51           valueFrom:
52             fieldRef:
53               apiVersion: v1
54               fieldPath: metadata.namespace
55         resources:
56           limits:
57             cpu: 100m
58             memory: 100Mi
59           requests:
60             cpu: 3m
61             memory: 20Mi
62       {{ end }}
63       containers:
64         - name: {{ include "common.name" . }}
65           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
66           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
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 }}
81           ports:
82           - containerPort: {{ template "wfd-be.internalPort" . }}
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:
88               port: {{ template "wfd-be.internalPort" . }}
89             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
90             periodSeconds: {{ .Values.liveness.periodSeconds }}
91             successThreshold: {{ .Values.liveness.successThreshold }}
92             failureThreshold: {{ .Values.liveness.failureThreshold }}
93           {{ end }}
94           readinessProbe:
95             tcpSocket:
96               port: {{ template "wfd-be.internalPort" . }}
97             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
98             periodSeconds: {{ .Values.readiness.periodSeconds }}
99             successThreshold: {{ .Values.readiness.successThreshold }}
100             failureThreshold: {{ .Values.readiness.failureThreshold }}
101           startupProbe:
102             tcpSocket:
103               port: {{ template "wfd-be.internalPort" . }}
104             initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
105             periodSeconds: {{ .Values.startup.periodSeconds }}
106             successThreshold: {{ .Values.startup.successThreshold }}
107             failureThreshold: {{ .Values.startup.failureThreshold }}
108           env:
109           - name: JAVA_OPTIONS
110             value: {{ .Values.config.javaOptions }}
111           - name: CS_HOSTS
112             value: "{{ .Values.global.sdc_cassandra.serviceName }}"
113           - name: CS_PORT
114             value: "{{ .Values.config.cassandraClientPort }}"
115           - name: CS_AUTHENTICATE
116             value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
117           - name: CS_USER
118             valueFrom:
119               secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
120           - name: CS_PASSWORD
121             valueFrom:
122               secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
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
128             valueFrom:
129               secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_truststore_password}
130           - name: SDC_PROTOCOL
131             value: "{{ .Values.config.sdcProtocol }}"
132           - name: SDC_ENDPOINT
133             value: "{{ .Values.config.sdcEndpoint }}"
134           - name: SDC_USER
135             value: "{{ .Values.config.sdcExternalUser }}"
136           - name: SDC_PASSWORD
137             valueFrom:
138               secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: wf_external_user_password}
139           - name: SERVER_SSL_ENABLED
140             value: "{{ .Values.config.serverSSLEnabled }}"
141           - name: SERVER_SSL_KEYSTORE_TYPE
142             value: "{{ .Values.config.serverSSLKeyStoreType }}"
143           - name: SERVER_SSL_TRUSTSTORE_TYPE
144             value: "{{ .Values.config.serverSSLTrustStoreType }}"
145           volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
146           resources: {{ include "common.resources" . | nindent 12 }}
147       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
148       volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
149       imagePullSecrets:
150       - name: "{{ include "common.namespace" . }}-docker-registry-key"