blob: abc6228f0a7322e3aed8588a1891b4110b9ab8f3 [file] [log] [blame]
Jakub Latusekbe896842020-10-21 13:36:29 +02001{{/*
Prateekinlinux445a18e2018-08-01 06:48:33 +00002# Copyright © 2018 Amdocs, Bell Canada , ZTE
Sylvain Desbureaux55af6482020-11-02 18:21:11 +01003# Copyright © 2021 Orange
Prateekinlinux445a18e2018-08-01 06:48:33 +00004#
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.
Jakub Latusekbe896842020-10-21 13:36:29 +020016*/}}
Grzegorz-Lis055b6ce2020-07-23 10:03:54 +020017apiVersion: apps/v1
BorislavG0433c912018-03-21 18:35:30 +020018kind: Deployment
Andreas Geissler8d87db22022-09-15 21:14:00 +020019metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
BorislavG0433c912018-03-21 18:35:30 +020020spec:
Andreas Geissler8d87db22022-09-15 21:14:00 +020021 selector: {{- include "common.selectors" . | nindent 4 }}
BorislavG0433c912018-03-21 18:35:30 +020022 replicas: {{ .Values.replicaCount }}
23 template:
Andreas Geissler8d87db22022-09-15 21:14:00 +020024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
BorislavG0433c912018-03-21 18:35:30 +020025 spec:
26 initContainers:
27 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020028 - /app/ready.py
BorislavG0433c912018-03-21 18:35:30 +020029 args:
30 - --container-name
31 - msb-discovery
32 env:
33 - name: NAMESPACE
34 valueFrom:
35 fieldRef:
36 apiVersion: v1
37 fieldPath: metadata.namespace
Sylvain Desbureauxfd2f8b82020-11-21 22:50:06 +010038 image: {{ include "repositoryGenerator.image.readiness" . }}
BorislavG0433c912018-03-21 18:35:30 +020039 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40 name: {{ include "common.name" . }}-readiness
Andreas Geissler47537432024-02-27 08:55:23 +010041 resources:
42 limits:
43 cpu: "100m"
44 memory: "0.5Gi"
45 requests:
46 cpu: "3m"
47 memory: "0.02Gi"
BorislavG0433c912018-03-21 18:35:30 +020048 containers:
49 - name: {{ include "common.name" . }}
Sylvain Desbureauxfd2f8b82020-11-21 22:50:06 +010050 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
BorislavG0433c912018-03-21 18:35:30 +020051 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler8d87db22022-09-15 21:14:00 +020052 ports: {{- include "common.containerPorts" . | indent 10 }}
BorislavG0433c912018-03-21 18:35:30 +020053 # disable liveness probe when breakpoints set in debugger
54 # so K8s doesn't restart unresponsive container
55 {{- if eq .Values.liveness.enabled true }}
56 livenessProbe:
57 tcpSocket:
vladimir turokd8044182023-07-27 16:28:36 +020058 port: {{ .Values.service.internalPort }}
BorislavG0433c912018-03-21 18:35:30 +020059 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.liveness.periodSeconds }}
61 {{ end -}}
62 readinessProbe:
63 tcpSocket:
vladimir turokd8044182023-07-27 16:28:36 +020064 port: {{ .Values.service.internalPort }}
BorislavG0433c912018-03-21 18:35:30 +020065 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66 periodSeconds: {{ .Values.readiness.periodSeconds }}
67 env:
68 - name: CONSUL_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030069 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020070 - name: SDCLIENT_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030071 value: msb-discovery.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020072 - name: ROUTE_LABELS
73 value: {{ .Values.config.routeLabels }}
74 volumeMounts:
75 - mountPath: /etc/localtime
76 name: localtime
77 readOnly: true
LiZi4dd8e112018-04-09 07:34:04 -040078 - mountPath: /usr/local/apiroute-works/logs
Li Zic5290dc2018-08-06 09:26:27 +000079 name: {{ include "common.fullname" . }}-logs
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010080 resources: {{ include "common.resources" . | nindent 12 }}
BorislavG0433c912018-03-21 18:35:30 +020081 {{- if .Values.nodeSelector }}
82 nodeSelector:
83{{ toYaml .Values.nodeSelector | indent 10 }}
84 {{- end -}}
85 {{- if .Values.affinity }}
86 affinity:
87{{ toYaml .Values.affinity | indent 10 }}
88 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -040089 # side car containers
Maciej Wereski0763e6e2021-11-18 11:48:25 +010090 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmya4478e82021-10-11 13:48:11 +020091 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
BorislavG0433c912018-03-21 18:35:30 +020092 volumes:
Li Zic5290dc2018-08-06 09:26:27 +000093 - name: {{ include "common.fullname" . }}-log-conf
94 configMap:
95 name: {{ include "common.fullname" . }}-log
Maciej Wereski0763e6e2021-11-18 11:48:25 +010096 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
Li Zic5290dc2018-08-06 09:26:27 +000097 - name: {{ include "common.fullname" . }}-logs
98 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +020099 - name: localtime
100 hostPath:
101 path: /etc/localtime
BorislavG0433c912018-03-21 18:35:30 +0200102 imagePullSecrets:
103 - name: "{{ include "common.namespace" . }}-docker-registry-key"