blob: da2afc3bfcc135f0e035bcf820781ec389fd8ca5 [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:
Andreas Geissleree119102024-04-11 13:53:39 +020030 - --service-name
BorislavG0433c912018-03-21 18:35:30 +020031 - 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"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010044 memory: "500Mi"
Andreas Geissler47537432024-02-27 08:55:23 +010045 requests:
46 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010047 memory: "20Mi"
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:
LiZi4dd8e112018-04-09 07:34:04 -040075 - mountPath: /usr/local/apiroute-works/logs
Li Zic5290dc2018-08-06 09:26:27 +000076 name: {{ include "common.fullname" . }}-logs
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010077 resources: {{ include "common.resources" . | nindent 12 }}
BorislavG0433c912018-03-21 18:35:30 +020078 {{- if .Values.nodeSelector }}
79 nodeSelector:
80{{ toYaml .Values.nodeSelector | indent 10 }}
81 {{- end -}}
82 {{- if .Values.affinity }}
83 affinity:
84{{ toYaml .Values.affinity | indent 10 }}
85 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -040086 # side car containers
Maciej Wereski0763e6e2021-11-18 11:48:25 +010087 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmya4478e82021-10-11 13:48:11 +020088 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
BorislavG0433c912018-03-21 18:35:30 +020089 volumes:
Li Zic5290dc2018-08-06 09:26:27 +000090 - name: {{ include "common.fullname" . }}-log-conf
91 configMap:
92 name: {{ include "common.fullname" . }}-log
Maciej Wereski0763e6e2021-11-18 11:48:25 +010093 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
Li Zic5290dc2018-08-06 09:26:27 +000094 - name: {{ include "common.fullname" . }}-logs
95 emptyDir: {}
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +010096 {{- include "common.imagePullSecrets" . | nindent 6 }}