1111 {{- end }}
1212 {{- end }}
1313
14- {{- $hasPVCExists := false -}}
15- {{- if .Values.persistentVolumeClaim.name }}
16- {{- $hasPVCExists = true }}
17- {{- end }}
18-
1914 {{- $hasSecretEnvExists := false -}}
2015 {{- $hasSecretVolumeExists := false -}}
2116 {{- if .Values.ConfigSecrets.enabled }}
@@ -51,12 +46,10 @@ metadata:
5146 annotations :
5247{{ toYaml .Values.deploymentAnnotations | indent 4 }}
5348{{- end }}
49+
5450spec :
5551 selector :
5652 matchLabels :
57- {{- if .Values.customMatchLabels }}
58- {{ toYaml .Values.customMatchLabels | indent 6 }}
59- {{- end }}
6053 app : {{ template ".Chart.Name .name" $ }}
6154 release : {{ $.Release.Name }}
6255 replicas : {{ $.Values.replicaCount }}
7467 appId : {{ $.Values.app | quote }}
7568 envId : {{ $.Values.env | quote }}
7669 release : {{ $.Release.Name }}
77- {{- if .Values.customPodLabels }}
78- {{ toYaml .Values.customPodLabels | indent 8 }}
79- {{- end }}
8070{{- if .Values.appLabels }}
8171{{ toYaml .Values.appLabels | indent 8 }}
8272{{- end }}
@@ -103,18 +93,12 @@ spec:
10393 operator : In
10494 values :
10595 - {{ $.Values.Spec.Affinity.Values | default "nodes" }}
106- {{- else if $.Values.affinity.enabled }}
107- affinity :
108- {{ toYaml .Values.affinity.values | indent 8 }}
10996{{- end }}
11097{{- if $.Values.serviceAccountName }}
11198 serviceAccountName : {{ $.Values.serviceAccountName }}
11299{{- else }}
113100 serviceAccountName : {{ template "serviceAccountName" . }}
114101{{- end }}
115- {{- if $.Values.schedulerName }}
116- schedulerName : {{ .Values.schedulerName }}
117- {{- end }}
118102 {{- if .Values.tolerations }}
119103 tolerations :
120104{{ toYaml .Values.tolerations | indent 8 }}
@@ -145,10 +129,6 @@ spec:
145129 {{- end }}
146130{{- end }}
147131{{- end }}
148- {{- if $.Values.topologySpreadConstraint }}
149- topologySpreadConstraints :
150- {{ toYaml .Values.topologySpreadConstraint }}
151- {{- end }}
152132{{- if $.Values.podSecurityContext }}
153133 securityContext :
154134{{ toYaml .Values.podSecurityContext | indent 8 }}
@@ -171,10 +151,6 @@ spec:
171151 command :
172152{{ toYaml .command | indent 12 -}}
173153{{- end}}
174- {{- if .args}}
175- args :
176- {{ toYaml .args | indent 12 -}}
177- {{- end}}
178154{{- if .resources}}
179155 resources :
180156{{ toYaml .resources | indent 12 -}}
@@ -190,6 +166,64 @@ spec:
190166{{- end}}
191167{{- end}}
192168 containers :
169+ {{- if $.Values.appMetrics }}
170+ - name : envoy
171+ image : {{ $.Values.envoyproxy.image | default "envoyproxy/envoy:v1.14.1"}}
172+ {{- if $.Values.envoyproxy.lifecycle }}
173+ lifecycle :
174+ {{ toYaml .Values.envoyproxy.lifecycle | indent 12 -}}
175+ {{- else if $.Values.containerSpec.lifecycle.enabled }}
176+ lifecycle :
177+ {{- if $.Values.containerSpec.lifecycle.preStop }}
178+ preStop :
179+ {{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}}
180+ {{- end }}
181+ {{- end }}
182+ resources :
183+ {{ toYaml $.Values.envoyproxy.resources | trim | indent 12 }}
184+ ports :
185+ - containerPort : 9901
186+ protocol : TCP
187+ name : envoy-admin
188+ {{- range $index, $element := .Values.ContainerPort }}
189+ - name : {{ $element.name}}
190+ containerPort : {{ $element.envoyPort | default (add 8790 $index) }}
191+ protocol : TCP
192+ {{- end }}
193+ command : ["/usr/local/bin/envoy"]
194+ args : ["-c", "/etc/envoy-config/envoy-config.json", "-l", "info", "--log-format", "[METADATA][%Y-%m-%d %T.%e][%t][%l][%n] %v"]
195+ volumeMounts :
196+ - name : {{ $.Values.envoyproxy.configMapName | default "envoy-config-volume" }}
197+ mountPath : /etc/envoy-config/
198+ {{- end}}
199+ {{- if $.Values.containers }}
200+ {{- range $i, $c := .Values.containers }}
201+ {{- if .reuseContainerImage}}
202+ - name : {{ $.Chart.Name }}-sidecontainer-{{ add1 $i }}
203+ image : " {{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}"
204+ imagePullPolicy : {{ $.Values.image.pullPolicy }}
205+ {{- if .securityContext }}
206+ securityContext :
207+ {{ toYaml .securityContext | indent 12 }}
208+ {{- end }}
209+ {{- if .command}}
210+ command :
211+ {{ toYaml .command | indent 12 -}}
212+ {{- end}}
213+ {{- if .resources}}
214+ resources :
215+ {{ toYaml .resources | indent 12 -}}
216+ {{- end}}
217+ {{- if .volumeMounts}}
218+ volumeMounts :
219+ {{ toYaml .volumeMounts | indent 12 -}}
220+ {{- end}}
221+ {{- else}}
222+ -
223+ {{ toYaml . | indent 10 }}
224+ {{- end}}
225+ {{- end}}
226+ {{- end}}
193227 - name : {{ $.Chart.Name }}
194228 image : " {{ .Values.server.deployment.image }}:{{ .Values.server.deployment.image_tag }}"
195229 imagePullPolicy : {{ $.Values.image.pullPolicy }}
@@ -218,15 +252,11 @@ spec:
218252{{- if $.Values.containerExtraSpecs }}
219253{{ toYaml .Values.containerExtraSpecs | indent 10 }}
220254{{- end }}
221- {{- if $.Values.resizePolicy }}
222- resizePolicy :
223- {{ toYaml .Values.resizePolicy | indent 12 }}
224- {{- end }}
225255 ports :
226256 {{- range $.Values.ContainerPort }}
227257 - name : {{ .name}}
228258 containerPort : {{ .port }}
229- protocol : {{ .protocol }}
259+ protocol : TCP
230260 {{- end}}
231261{{- if and $.Values.command.enabled $.Values.command.workingDir }}
232262 workingDir : {{ $.Values.command.workingDir }}
@@ -241,9 +271,9 @@ spec:
241271{{- end }}
242272 env :
243273 - name : CONFIG_HASH
244- value : {{ include (print $.Chart.Name "/templates/configmap.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.ConfigHash) }}{{ .Values.devtronInternal.containerSpecs.ConfigHash }}{{ end }}
274+ value : {{ include (print $.Chart.Name "/templates/configmap.yaml") . | sha256sum }}
245275 - name : SECRET_HASH
246- value : {{ include (print $.Chart.Name "/templates/secret.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.SecretHash) }}{{ .Values.devtronInternal.containerSpecs.SecretHash }}{{ end }}
276+ value : {{ include (print $.Chart.Name "/templates/secret.yaml") . | sha256sum }}
247277 - name : DEVTRON_APP_NAME
248278 value : {{ template ".Chart.Name .name" $ }}
249279 - name : POD_NAME
@@ -318,7 +348,6 @@ spec:
318348 httpGet :
319349 path : {{ $.Values.LivenessProbe.Path }}
320350 port : {{ $.Values.LivenessProbe.port }}
321- scheme : {{ $.Values.LivenessProbe.scheme }}
322351 {{- if $.Values.LivenessProbe.httpHeaders }}
323352 httpHeaders :
324353 {{- range $.Values.LivenessProbe.httpHeaders}}
@@ -352,7 +381,6 @@ spec:
352381 httpGet :
353382 path : {{ $.Values.ReadinessProbe.Path }}
354383 port : {{ $.Values.ReadinessProbe.port }}
355- scheme : {{ $.Values.ReadinessProbe.scheme }}
356384 {{- if $.Values.ReadinessProbe.httpHeaders }}
357385 httpHeaders :
358386 {{- range $.Values.ReadinessProbe.httpHeaders}}
@@ -419,10 +447,6 @@ spec:
419447{{- with .Values.volumeMounts }}
420448{{ toYaml . | trim | indent 12 }}
421449{{- end }}
422- {{- if $.Values.persistentVolumeClaim.name }}
423- - name : {{ .Values.persistentVolumeClaim.name }}-vol
424- mountPath : {{ .Values.persistentVolumeClaim.mountPath | default "/tmp" }}
425- {{- end}}
426450 {{- if .Values.ConfigMaps.enabled }}
427451 {{- range .Values.ConfigMaps.maps }}
428452 {{- if eq .type "volume"}}
@@ -462,87 +486,8 @@ spec:
462486 {{- end }}
463487 {{- end }}
464488 {{- end }}
465- {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }}
466- {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }}
467- {{- if $.Values.appMetrics }}
468- - name : envoy
469- image : {{ $.Values.envoyproxy.image | default "envoyproxy/envoy:v1.14.1"}}
470- {{- if $.Values.envoyproxy.lifecycle }}
471- lifecycle :
472- {{ toYaml .Values.envoyproxy.lifecycle | indent 12 -}}
473- {{- else if $.Values.containerSpec.lifecycle.enabled }}
474- lifecycle :
475- {{- if $.Values.containerSpec.lifecycle.preStop }}
476- preStop :
477- {{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}}
478- {{- end }}
479- {{- end }}
480- resources :
481- {{ toYaml $.Values.envoyproxy.resources | trim | indent 12 }}
482- ports :
483- - containerPort : 9901
484- protocol : TCP
485- name : envoy-admin
486- {{- range $index, $element := .Values.ContainerPort }}
487- - name : {{ $element.name}}
488- containerPort : {{ $element.envoyPort | default (add 8790 $index) }}
489- protocol : TCP
490- {{- end }}
491- command : ["/usr/local/bin/envoy"]
492- args : ["-c", "/etc/envoy-config/envoy-config.json", "-l", "info", "--log-format", "[METADATA][%Y-%m-%d %T.%e][%t][%l][%n] %v"]
493- volumeMounts :
494- - name : {{ $.Values.envoyproxy.configMapName | default "envoy-config-volume" }}
495- mountPath : /etc/envoy-config/
496- {{- if $.Values.envoyproxy.readinessProbe}}
497- readinessProbe :
498- {{ toYaml $.Values.envoyproxy.readinessProbe | indent 12}}
499- {{- end }}
500- {{- if $.Values.envoyproxy.livenessProbe}}
501- readinessProbe :
502- {{ toYaml $.Values.envoyproxy.livenessProbe | indent 12}}
503- {{- end }}
504- {{- end}}
505- {{- if $.Values.containers }}
506- {{- range $i, $c := .Values.containers }}
507- {{- if .reuseContainerImage}}
508- - name : {{ $.Chart.Name }}-sidecontainer-{{ add1 $i }}
509- image : " {{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}"
510- imagePullPolicy : {{ $.Values.image.pullPolicy }}
511- {{- if .env }}
512- env :
513- {{ toYaml .env | indent 12 }}
514- {{- end }}
515- {{- if .envFrom }}
516- envFrom :
517- {{ toYaml .env | indent 12 }}
518- {{- end }}
519- {{- if .securityContext }}
520- securityContext :
521- {{ toYaml .securityContext | indent 12 }}
522- {{- end }}
523- {{- if .command}}
524- command :
525- {{ toYaml .command | indent 12 -}}
526- {{- end}}
527- {{- if .resizePolicy }}
528- resizePolicy :
529- {{ toYaml .resziePolicy | indent 12}}
530- {{- end }}
531- {{- if .resources}}
532- resources :
533- {{ toYaml .resources | indent 12 -}}
534- {{- end}}
535- {{- if .volumeMounts}}
536- volumeMounts :
537- {{ toYaml .volumeMounts | indent 12 -}}
538- {{- end}}
539- {{- else}}
540- -
541- {{ toYaml . | indent 10 }}
542- {{- end}}
543- {{- end}}
544- {{- end}}
545-
489+ {{- if and (eq (len .Values.volumes) 0) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }}
490+ {{- if and (eq (len .Values.volumeMounts) 0) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} []{{- end }}
546491
547492 volumes :
548493 {{- if $.Values.appMetrics }}
@@ -553,11 +498,6 @@ spec:
553498{{- with .Values.volumes }}
554499{{ toYaml . | trim | indent 8 }}
555500{{- end }}
556- {{- if .Values.persistentVolumeClaim.name }}
557- - name : {{.Values.persistentVolumeClaim.name}}-vol
558- persistentVolumeClaim :
559- claimName : {{.Values.persistentVolumeClaim.name }}
560- {{- end}}
561501 {{- if .Values.ConfigMaps.enabled }}
562502 {{- range .Values.ConfigMaps.maps }}
563503 {{- if eq .type "volume"}}
@@ -593,8 +533,8 @@ spec:
593533 {{- end }}
594534 {{- end }}
595535 {{- end }}
596- {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) ( or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }}
597- {{- if and (eq (len .Values.volumeMounts ) 0) (eq ($hasPVCExists ) false) (eq (.Values.ConfigSecrets .enabled) false) (eq (.Values.ConfigMaps.enabled ) false) }} [] {{- end }}
536+ {{- if and (eq (len .Values.volumes) 0) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) (eq (.Values.appMetrics ) false) }} []{{- end }}
537+ {{- if and (eq (len .Values.volumes ) 0) (eq (.Values.ConfigSecrets.enabled ) false) (eq (.Values.ConfigMaps .enabled) false) (eq (.Values.appMetrics ) false) }} []{{- end }}
598538
599539 revisionHistoryLimit : 3
600540# # pauseForSecondsBeforeSwitchActive: {{ $.Values.pauseForSecondsBeforeSwitchActive }}
@@ -608,4 +548,4 @@ spec:
608548 {{- end }}
609549 {{- if eq .Values.deploymentType "RECREATE" }}
610550 type : " Recreate"
611- {{- end }}
551+ {{- end }}
0 commit comments