blob: 13495586515ed3c413ffe2684f90bfcc1866a937 [file] [log] [blame]
Jakub Latusekfcf67842020-10-21 13:36:29 +02001{{/*
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00002# Copyright © 2017 Amdocs, Bell Canada
Mukul379e2522018-09-05 12:26:02 +00003# Modifications Copyright © 2018 AT&T
vaibhav_16dece04b2fe2018-03-22 09:07:12 +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 Latusekfcf67842020-10-21 13:36:29 +020016*/}}
vaibhav_16dece04b2fe2018-03-22 09:07:12 +000017
Magdalena_Biernacka7d0dcbe2020-07-12 23:21:43 +020018apiVersion: apps/v1
vaibhav_16decf67e4182018-03-19 05:45:47 +000019kind: Deployment
20metadata:
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000027 heritage: {{ .Release.Service }}
28spec:
29 replicas: {{ .Values.replicaCount }}
Magdalena_Biernacka7d0dcbe2020-07-12 23:21:43 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000033 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000038 spec:
39 initContainers:
40 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020041 - /app/ready.py
vaibhav_16decf67e4182018-03-19 05:45:47 +000042 args:
43 - --container-name
sebdet5c449882021-01-13 11:35:56 +010044 - policy-clamp-be
vaibhav_16decf67e4182018-03-19 05:45:47 +000045 env:
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
Sylvain Desbureauxf83984f2020-11-21 21:32:40 +010051 image: {{ include "repositoryGenerator.image.readiness" . }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000052 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 name: {{ include "common.name" . }}-readiness
ChrisC2325efd2020-09-11 18:39:23 +020054{{ include "common.certInitializer.initContainer" . | nindent 6 }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000055 containers:
ac2550de009892018-05-24 15:47:05 +020056 # side car containers
Sylvain Desbureaux8c2a1622020-04-22 10:50:26 +020057 {{ if .Values.global.centralizedLoggingEnabled }}{{ include "common.log.sidecar" . | nindent 8 }}{{ end }}
58 # main container
vaibhav_16decf67e4182018-03-19 05:45:47 +000059 - name: {{ include "common.name" . }}
Sylvain Desbureauxf83984f2020-11-21 21:32:40 +010060 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000061 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 ports:
63 - containerPort: {{ .Values.service.internalPort }}
64 # disable liveness probe when breakpoints set in debugger
65 # so K8s doesn't restart unresponsive container
66 {{- if eq .Values.liveness.enabled true }}
67 livenessProbe:
68 tcpSocket:
69 port: {{ .Values.service.internalPort }}
70 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
71 periodSeconds: {{ .Values.liveness.periodSeconds }}
72 {{ end -}}
73 readinessProbe:
74 tcpSocket:
75 port: {{ .Values.service.internalPort }}
76 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
77 periodSeconds: {{ .Values.readiness.periodSeconds }}
ChrisC2325efd2020-09-11 18:39:23 +020078 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Sylvain Desbureaux8c2a1622020-04-22 10:50:26 +020079 - name: logs
80 mountPath: {{ .Values.log.path }}
sebdet93b4fd42020-03-25 09:19:34 -070081 - mountPath: /etc/nginx/conf.d/default.conf
ac25507895b2c2018-05-16 14:31:23 +020082 name: {{ include "common.fullname" . }}-config
sebdet93b4fd42020-03-25 09:19:34 -070083 subPath: default.conf
vaibhav_16decf67e4182018-03-19 05:45:47 +000084 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000085{{ include "common.resources" . | indent 12 }}
vaibhav_16decf67e4182018-03-19 05:45:47 +000086 {{- if .Values.nodeSelector }}
87 nodeSelector:
88{{ toYaml .Values.nodeSelector | indent 10 }}
89 {{- end -}}
90 {{- if .Values.affinity }}
91 affinity:
92{{ toYaml .Values.affinity | indent 10 }}
93 {{- end }}
farida azmyc1178372021-04-11 12:55:33 +020094 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
ChrisC2325efd2020-09-11 18:39:23 +020095 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
ac25507895b2c2018-05-16 14:31:23 +020096 - name: {{ include "common.fullname" . }}-config
97 configMap:
98 name: {{ include "common.fullname" . }}
99 items:
sebdet93b4fd42020-03-25 09:19:34 -0700100 - key: default.conf
101 path: default.conf
Sylvain Desbureaux8c2a1622020-04-22 10:50:26 +0200102 - name: logs
ac2550de009892018-05-24 15:47:05 +0200103 emptyDir: {}
Sylvain Desbureaux8c2a1622020-04-22 10:50:26 +0200104 {{ if .Values.global.centralizedLoggingEnabled }}{{ include "common.log.volumes" . | nindent 8 }}{{ end }}
vaibhav_16decf67e4182018-03-19 05:45:47 +0000105 imagePullSecrets:
106 - name: "{{ include "common.namespace" . }}-docker-registry-key"