Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / cds / components / cds-command-executor / templates / deployment.yaml
1 {{/*
2 # Copyright (c) 2019 Bell Canada
3 #
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 */}}
16
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   selector: {{- include "common.selectors" . | nindent 4 }}
22   replicas: {{ .Values.replicaCount }}
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         - cds-blueprints-processor-http
32         env:
33         - name: NAMESPACE
34           valueFrom:
35             fieldRef:
36               apiVersion: v1
37               fieldPath: metadata.namespace
38         {{- if .Values.metrics.serviceMonitor.enabled }}
39         - name: PROMETHEUS_METRICS_ENABLED
40           value: {{ .Values.metrics.serviceMonitor.enabled | quote }}
41         - name: PROMETHEUS_PORT
42           value: {{ .Values.metrics.serviceMonitor.internalPort | quote }}
43         {{ end }}
44         image: {{ include "repositoryGenerator.image.readiness" . }}
45         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46         name: {{ include "common.name" . }}-readiness
47         resources:
48           limits:
49             cpu: "100m"
50             memory: "500Mi"
51           requests:
52             cpu: "3m"
53             memory: "20Mi"
54       containers:
55         - name: {{ include "common.name" . }}
56           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
57           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
58           ports: {{ include "common.containerPorts" . | nindent 12  }}
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             timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
66           {{ end }}
67           readinessProbe:
68             tcpSocket:
69               port: {{ .Values.service.internalPort }}
70             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
71             periodSeconds: {{ .Values.readiness.periodSeconds }}
72             timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
73           volumeMounts:
74           - mountPath: {{ .Values.persistence.deployedBlueprint }}
75             name: {{ include "common.fullname" . }}-blueprints
76           resources: {{ include "common.resources" . | nindent 12 }}
77         {{- if .Values.nodeSelector }}
78         nodeSelector:
79 {{ toYaml .Values.nodeSelector | indent 10 }}
80         {{- end -}}
81         {{- if .Values.affinity }}
82         affinity:
83 {{ toYaml .Values.affinity | indent 10 }}
84         {{- end }}
85       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
86       volumes:
87         - name: {{ include "common.fullname" . }}-blueprints
88         {{- if .Values.persistence.enabled }}
89           persistentVolumeClaim:
90             claimName: {{ include "common.release" . }}-cds-blueprints
91         {{- else }}
92           emptyDir: {}
93         {{- end }}
94       {{- include "common.imagePullSecrets" . | nindent 6 }}