diff --git a/stack/templates/_helpers.tpl b/stack/templates/_helpers.tpl index 463aad7..7bf9d84 100644 --- a/stack/templates/_helpers.tpl +++ b/stack/templates/_helpers.tpl @@ -113,10 +113,14 @@ envFrom: {{- end }} {{- define "service.nonsensitiveEnvVars" -}} -{{- if .Values.env }} +{{- $envs := list }} +{{- range $i, $envHolder := . -}} +{{ $envs = concat $envs (default (list) $envHolder.env) }} +{{- end -}} +{{- if ne (len $envs) 0 -}} env: -{{ toYaml .Values.env }} -{{- else }} +{{ toYaml (uniq $envs) }} +{{- else -}} env: [] {{- end }} {{- end }} @@ -127,4 +131,4 @@ image: {{ .Values.image }} {{ else }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/stack/templates/context_configmap.yaml b/stack/templates/context_configmap.yaml index 47fe05e..6e0ecf0 100644 --- a/stack/templates/context_configmap.yaml +++ b/stack/templates/context_configmap.yaml @@ -9,5 +9,8 @@ metadata: data: __ARGUS_STACK_NAME: {{ $global.Release.Name }} __ARGUS_STACK_INGRESS_HOST: {{ .ingress.host }} + {{- if .deploymentStage }} + __ARGUS_DEPLOYMENT_STAGE: {{ .deploymentStage }} + {{- end }} {{- end }} {{- end }} diff --git a/stack/templates/cronjob.yaml b/stack/templates/cronjob.yaml index e591ad0..146e373 100644 --- a/stack/templates/cronjob.yaml +++ b/stack/templates/cronjob.yaml @@ -36,11 +36,7 @@ spec: resources: {{- toYaml .Values.resources | nindent 14 }} {{- include "service.configuration" . | nindent 12 }} - {{- $env := concat $global.Values.global.env (fromYaml (include "service.nonsensitiveEnvVars" .)).env }} - {{- if $env }} - env: - {{- toYaml (uniq $env) | nindent 14 }} - {{- end }} + {{- include "service.nonsensitiveEnvVars" (list $global.Values.global $cronJob.Values) | nindent 12 }} restartPolicy: OnFailure {{- with .Values.nodeSelector }} nodeSelector: diff --git a/stack/templates/deployment.yaml b/stack/templates/deployment.yaml index 9d40c39..140cfe0 100644 --- a/stack/templates/deployment.yaml +++ b/stack/templates/deployment.yaml @@ -19,6 +19,7 @@ spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} + progressDeadlineSeconds: {{ .Values.progressDeadlineSeconds }} revisionHistoryLimit: 3 selector: matchLabels: @@ -75,25 +76,23 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} {{- include "service.configuration" . | nindent 10}} - {{- $env := concat $global.Values.global.env (fromYaml (include "service.nonsensitiveEnvVars" .)).env }} - {{- if $env }} - env: - {{- toYaml (uniq $env) | nindent 12}} - {{- end }} + {{- include "service.nonsensitiveEnvVars" (list $global.Values.global .Values) | nindent 10 }} {{- range $i, $container := .Values.sidecars }} - {{- with omit $container "envFrom" }} + {{- with omit $container "envFrom" "env" }} - {{- toYaml . | nindent 10 }} {{- include "service.configuration" $service | nindent 10}} {{- end }} + {{- include "service.nonsensitiveEnvVars" (list $global.Values.global $service.Values $container) | nindent 10 }} {{- end }} initContainers: {{- range $i, $container := .Values.initContainers }} {{- $imageDict := fromYaml (include "initContainer.image" (dict "Chart" $global.Chart "Values" $container)) }} {{- $container = mergeOverwrite $container $imageDict }} - {{- with omit $container "envFrom" }} + {{- with omit $container "envFrom" "env" }} - {{- toYaml . | nindent 10 }} {{- include "service.configuration" $service | nindent 10}} {{- end }} + {{- include "service.nonsensitiveEnvVars" (list $global.Values.global $service.Values $container) | nindent 10 }} {{- end }} dnsPolicy: {{ .Values.dnsPolicy }} restartPolicy: {{ .Values.restartPolicy }} diff --git a/stack/values.yaml b/stack/values.yaml index 61cd3b9..c383bff 100644 --- a/stack/values.yaml +++ b/stack/values.yaml @@ -1,5 +1,6 @@ # Service defaults global: + deploymentStage: '' replicaCount: 1 # Settings for the primary container @@ -50,6 +51,8 @@ global: command: - ps - '-ef' + + progressDeadlineSeconds: 600 resources: limits: