Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / cds / components / cds-sdc-listener / templates / deployment.yaml
1 {{/*
2 # Copyright (c) 2019 Bell Canada
3 # Modification Copyright © 2022 Nordix Foundation
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 apiVersion: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   replicas: {{ .Values.replicaCount }}
22   selector: {{- include "common.selectors" . | nindent 4 }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       initContainers:
27         - command:
28           - /app/ready.py
29           args:
30             - --service-name
31             - sdc-be
32             - --service-name
33             - cds-blueprints-processor-http
34           env:
35           - name: NAMESPACE
36             valueFrom:
37               fieldRef:
38                 apiVersion: v1
39                 fieldPath: metadata.namespace
40           image: {{ include "repositoryGenerator.image.readiness" . }}
41           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42           name: {{ include "common.name" . }}-readiness
43           resources:
44             limits:
45               cpu: "100m"
46               memory: "500Mi"
47             requests:
48               cpu: "3m"
49               memory: "20Mi"
50       containers:
51         - name: {{ include "common.name" . }}
52           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
53           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54           env:
55           - name: APP_CONFIG_HOME
56             value: {{ .Values.config.appConfigDir }}
57           - name: SASL_JAAS_CONFIG
58             valueFrom:
59               secretKeyRef:
60                 name: {{ include "common.name" . }}-ku
61                 key: sasl.jaas.config
62           ports: {{- include "common.containerPorts" . | nindent 12 }}
63           {{ if .Values.liveness.enabled }}
64           livenessProbe:
65             httpGet:
66               path: /api/v1/sdclistener/healthcheck
67               port: {{ .Values.service.internalPort }}
68             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
69             periodSeconds: {{ .Values.liveness.periodSeconds }}
70           {{end}}
71           readinessProbe:
72             httpGet:
73               path: /api/v1/sdclistener/healthcheck
74               port: {{ .Values.service.internalPort }}
75             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
76             periodSeconds: {{ .Values.readiness.periodSeconds }}
77           volumeMounts:
78           - mountPath: {{ .Values.config.appConfigDir }}/application.yaml
79             name: {{ include "common.fullname" . }}-config
80             subPath: application.yaml
81           - mountPath: {{ .Values.config.appConfigDir }}/logback.xml
82             name: {{ include "common.fullname" . }}-config
83             subPath: logback.xml
84           resources: {{ include "common.resources" . | nindent 12 }}
85         {{- if .Values.nodeSelector }}
86         nodeSelector:
87 {{ toYaml .Values.nodeSelector | indent 10 }}
88         {{- end -}}
89         {{- if .Values.affinity }}
90         affinity:
91 {{ toYaml .Values.affinity | indent 10 }}
92         {{- end }}
93       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
94       volumes:
95         - name: {{ include "common.fullname" . }}-config
96           configMap:
97             name: {{ include "common.fullname" . }}-configmap
98             items:
99             - key: application.yaml
100               path: application.yaml
101             - key: logback.xml
102               path: logback.xml
103       {{- include "common.imagePullSecrets" . | nindent 6 }}