Merge "[AAI] Add model-loader tracing config"
[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 # Modifications Copyright © 2023 Deutsche Telekom
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 */}}
18
19 apiVersion: apps/v1
20 kind: Deployment
21 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
22 spec:
23   selector: {{- include "common.selectors" . | nindent 4 }}
24   replicas: {{ .Values.replicaCount }}
25   template:
26     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
27     spec:
28       initContainers:
29       {{- if .Values.initJob.enabled }}
30       - name: {{ include "common.name" . }}-job-completion
31         image: {{ include "repositoryGenerator.image.readiness" . }}
32         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
33         command:
34         - /app/ready.py
35         args:
36         - --job-name
37         - {{ include "common.fullname" . }}
38         env:
39         - name: NAMESPACE
40           valueFrom:
41             fieldRef:
42               apiVersion: v1
43               fieldPath: metadata.namespace
44         resources:
45           limits:
46             cpu: "100m"
47             memory: "500Mi"
48           requests:
49             cpu: "3m"
50             memory: "20Mi"
51       {{ end }}
52       containers:
53         - name: {{ include "common.name" . }}
54           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
55           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56           ports: {{ include "common.containerPorts" . | nindent 12  }}
57           # disable liveness probe when breakpoints set in debugger
58           # so K8s doesn't restart unresponsive container
59           {{ if .Values.liveness.enabled }}
60           livenessProbe:
61             tcpSocket:
62               port: {{ .Values.service.internalPort }}
63             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
64             periodSeconds: {{ .Values.liveness.periodSeconds }}
65             successThreshold: {{ .Values.liveness.successThreshold }}
66             failureThreshold: {{ .Values.liveness.failureThreshold }}
67           {{ end }}
68           readinessProbe:
69             tcpSocket:
70               port: {{ .Values.service.internalPort }}
71             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
72             periodSeconds: {{ .Values.readiness.periodSeconds }}
73             successThreshold: {{ .Values.readiness.successThreshold }}
74             failureThreshold: {{ .Values.readiness.failureThreshold }}
75           startupProbe:
76             tcpSocket:
77               port: {{ .Values.service.internalPort }}
78             initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
79             periodSeconds: {{ .Values.startup.periodSeconds }}
80             successThreshold: {{ .Values.startup.successThreshold }}
81             failureThreshold: {{ .Values.startup.failureThreshold }}
82           env:
83           - name: JAVA_OPTIONS
84             value: {{ .Values.config.javaOptions }}
85           - name: CS_HOSTS
86             value: "{{ .Values.global.sdc_cassandra.serviceName }}"
87           - name: CS_PORT
88             value: "{{ .Values.config.cassandraClientPort }}"
89           - name: CS_AUTHENTICATE
90             value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
91           - name: CS_USER
92             valueFrom:
93               secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
94           - name: CS_PASSWORD
95             valueFrom:
96               secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
97           - name: CS_SSL_ENABLED
98             value: "{{ .Values.config.cassandraSSLEnabled }}"
99           - name: CS_TRUST_STORE_PATH
100             value: "{{ .Values.config.cassandraTrustStorePath }}"
101           - name: CS_TRUST_STORE_PASSWORD
102             valueFrom:
103               secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_truststore_password}
104           - name: SDC_PROTOCOL
105             value: "HTTP"
106           - name: SDC_ENDPOINT
107             value: "{{ .Values.config.sdcEndpoint.http }}"
108           - name: SDC_USER
109             value: "{{ .Values.config.sdcExternalUser }}"
110           - name: SDC_PASSWORD
111             valueFrom:
112               secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: wf_external_user_password}
113           - name: SERVER_SSL_ENABLED
114             value: "false"
115           resources: {{ include "common.resources" . | nindent 12 }}
116       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
117       {{- include "common.imagePullSecrets" . | nindent 6 }}