blob: 883f7f88460abc7d5f872d8c530545a938d28942 [file] [log] [blame]
Jakub Latusek50530762020-10-21 13:36:29 +02001{{/*
Alexis de Talhouët108e28f2019-04-14 18:54:56 -04002# Copyright (c) 2019 Bell Canada
Steve Alphonse Sianie20fd5e2019-01-25 16:16:29 -05003#
Mike Elliott37cae252018-09-12 14:45:40 -04004# 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.
Jakub Latusek50530762020-10-21 13:36:29 +020015*/}}
Mike Elliott37cae252018-09-12 14:45:40 -040016
Grzegorz-Lis9bd98782020-07-27 15:22:28 +020017apiVersion: apps/v1
Mike Elliott37cae252018-09-12 14:45:40 -040018kind: Deployment
Andreas Geissler11fcd6c2023-05-25 14:33:16 +020019metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Mike Elliott37cae252018-09-12 14:45:40 -040020spec:
Andreas Geissler11fcd6c2023-05-25 14:33:16 +020021 selector: {{- include "common.selectors" . | nindent 4 }}
Mike Elliott37cae252018-09-12 14:45:40 -040022 replicas: {{ .Values.replicaCount }}
23 template:
Andreas Geissler11fcd6c2023-05-25 14:33:16 +020024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Mike Elliott37cae252018-09-12 14:45:40 -040025 spec:
26 initContainers:
27 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020028 - /app/ready.py
Mike Elliott37cae252018-09-12 14:45:40 -040029 args:
30 - --container-name
Alexis de Talhouët108e28f2019-04-14 18:54:56 -040031 - cds-blueprints-processor
Mike Elliott37cae252018-09-12 14:45:40 -040032 env:
33 - name: NAMESPACE
34 valueFrom:
35 fieldRef:
36 apiVersion: v1
37 fieldPath: metadata.namespace
kuldiprd276d162021-08-31 15:13:52 -040038 {{- if .Values.metrics.serviceMonitor.enabled }}
39 - name: PROMETHEUS_METRICS_ENABLED
40 value: {{ .Values.metrics.serviceMonitor.enabled | quote }}
41 - name: PROMETHEUS_PORT
Andreas Geissler11fcd6c2023-05-25 14:33:16 +020042 value: {{ .Values.metrics.serviceMonitor.internalPort | quote }}
kuldiprd276d162021-08-31 15:13:52 -040043 {{ end }}
Sylvain Desbureaux503b2292020-11-21 22:29:17 +010044 image: {{ include "repositoryGenerator.image.readiness" . }}
Mike Elliott37cae252018-09-12 14:45:40 -040045 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 name: {{ include "common.name" . }}-readiness
47 containers:
48 - name: {{ include "common.name" . }}
Sylvain Desbureaux503b2292020-11-21 22:29:17 +010049 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Mike Elliott37cae252018-09-12 14:45:40 -040050 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler11fcd6c2023-05-25 14:33:16 +020051 ports: {{ include "common.containerPorts" . | nindent 12 }}
Mike Elliott37cae252018-09-12 14:45:40 -040052 {{ if .Values.liveness.enabled }}
53 livenessProbe:
54 tcpSocket:
Andreas Geissler11fcd6c2023-05-25 14:33:16 +020055 port: {{ .Values.service.internalPort }}
Mike Elliott37cae252018-09-12 14:45:40 -040056 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
57 periodSeconds: {{ .Values.liveness.periodSeconds }}
Oleg Mitsura3a621182019-10-09 12:40:11 -040058 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Mike Elliott37cae252018-09-12 14:45:40 -040059 {{ end }}
60 readinessProbe:
61 tcpSocket:
Andreas Geissler11fcd6c2023-05-25 14:33:16 +020062 port: {{ .Values.service.internalPort }}
Oleg Mitsurabad99342019-10-28 14:06:42 -040063 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
64 periodSeconds: {{ .Values.readiness.periodSeconds }}
65 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
Mike Elliott37cae252018-09-12 14:45:40 -040066 volumeMounts:
67 - mountPath: /etc/localtime
68 name: localtime
69 readOnly: true
Alexis de Talhouët108e28f2019-04-14 18:54:56 -040070 - mountPath: {{ .Values.persistence.deployedBlueprint }}
71 name: {{ include "common.fullname" . }}-blueprints
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010072 resources: {{ include "common.resources" . | nindent 12 }}
Mike Elliott37cae252018-09-12 14:45:40 -040073 {{- if .Values.nodeSelector }}
74 nodeSelector:
75{{ toYaml .Values.nodeSelector | indent 10 }}
76 {{- end -}}
77 {{- if .Values.affinity }}
78 affinity:
79{{ toYaml .Values.affinity | indent 10 }}
80 {{- end }}
farida azmyffad0322021-04-09 14:18:14 +020081 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Mike Elliott37cae252018-09-12 14:45:40 -040082 volumes:
83 - name: localtime
84 hostPath:
85 path: /etc/localtime
Alexis de Talhouët108e28f2019-04-14 18:54:56 -040086 - name: {{ include "common.fullname" . }}-blueprints
Jozsef Csongvai2b090702021-10-05 18:56:57 -040087 {{- if .Values.persistence.enabled }}
Alexis de Talhouët108e28f2019-04-14 18:54:56 -040088 persistentVolumeClaim:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010089 claimName: {{ include "common.release" . }}-cds-blueprints
Jozsef Csongvai2b090702021-10-05 18:56:57 -040090 {{- else }}
91 emptyDir: {}
92 {{- end }}
Mike Elliott37cae252018-09-12 14:45:40 -040093 imagePullSecrets:
94 - name: "{{ include "common.namespace" . }}-docker-registry-key"