From b7d8492ab836b478d118be86a1b98342c66be15c Mon Sep 17 00:00:00 2001 From: "Ethan Brown (Domino)" <111539728+ddl-ebrown@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:30:35 -0800 Subject: [PATCH] Flyte-core add missing podEnv values (#4807) * Flyte-core add missing podEnv values - In #4756 / fb9ffd56e81e7f7e4657cd668e53b2f1557e9178, flyte-core got consistent podEnv values established in values.yaml. However, these values were not properly injected into *all* the containers being used in various deployments. Fix that so that they are used in all deployments Signed-off-by: ddl-ebrown * Flyte-core chart prevent empty env: - Some linters consider empty env: as invalid k8s YAML, because env is typically an [] when no values are set Prevent rendering the console env block without values Signed-off-by: ddl-ebrown --------- Signed-off-by: ddl-ebrown --- .../templates/admin/deployment.yaml | 21 +++++++++++++++++++ .../templates/console/deployment.yaml | 2 ++ .../templates/datacatalog/deployment.yaml | 6 ++++++ .../templates/flytescheduler/deployment.yaml | 6 ++++++ .../templates/propeller/webhook.yaml | 5 +++++ .../flyte_aws_scheduler_helm_generated.yaml | 1 - .../flyte_helm_controlplane_generated.yaml | 1 - deployment/eks/flyte_helm_generated.yaml | 1 - .../flyte_helm_controlplane_generated.yaml | 1 - deployment/gcp/flyte_helm_generated.yaml | 1 - 10 files changed, 40 insertions(+), 5 deletions(-) diff --git a/charts/flyte-core/templates/admin/deployment.yaml b/charts/flyte-core/templates/admin/deployment.yaml index 5a081224a8..5b41085674 100755 --- a/charts/flyte-core/templates/admin/deployment.yaml +++ b/charts/flyte-core/templates/admin/deployment.yaml @@ -38,6 +38,12 @@ spec: volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 10 }} - mountPath: /etc/flyte/config name: base-config-volume + {{- if .Values.flyteadmin.env }} + env: + {{- with .Values.flyteadmin.env -}} + {{- tpl (toYaml .) $ | nindent 12 }} + {{- end }} + {{- end }} {{- if .Values.flyteadmin.initialProjects }} - command: - flyteadmin @@ -54,6 +60,12 @@ spec: volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 10 }} - mountPath: /etc/flyte/config name: base-config-volume + {{- if .Values.flyteadmin.env }} + env: + {{- with .Values.flyteadmin.env -}} + {{- tpl (toYaml .) $ | nindent 12 }} + {{- end }} + {{- end }} {{- end }} {{- if and (.Values.cluster_resource_manager.enabled) (not .Values.cluster_resource_manager.standalone_deploy) }} - command: @@ -77,6 +89,12 @@ spec: {{ tpl (toYaml .) $ | nindent 10 }} {{- end }} {{- end }} + {{- if .Values.flyteadmin.env }} + env: + {{- with .Values.flyteadmin.env -}} + {{- tpl (toYaml .) $ | nindent 12 }} + {{- end }} + {{- end }} {{- end }} - name: generate-secrets image: "{{ .Values.flyteadmin.image.repository }}:{{ .Values.flyteadmin.image.tag }}" @@ -96,6 +114,9 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + {{- with .Values.flyteadmin.env -}} + {{- tpl (toYaml .) $ | nindent 12 }} + {{- end }} containers: - command: - flyteadmin diff --git a/charts/flyte-core/templates/console/deployment.yaml b/charts/flyte-core/templates/console/deployment.yaml index 9ba1fc88ac..3d0f26d44b 100644 --- a/charts/flyte-core/templates/console/deployment.yaml +++ b/charts/flyte-core/templates/console/deployment.yaml @@ -37,7 +37,9 @@ spec: name: flyte-console-config ports: - containerPort: 8080 + {{- if or .Values.flyteconsole.ga.enabled .Values.flyteconsole.podEnv }} env: + {{- end }} {{- if .Values.flyteconsole.ga.enabled }} - name: ENABLE_GA value: "{{ .Values.flyteconsole.ga.enabled }}" diff --git a/charts/flyte-core/templates/datacatalog/deployment.yaml b/charts/flyte-core/templates/datacatalog/deployment.yaml index 72c18ac61b..9ba6a8d89a 100644 --- a/charts/flyte-core/templates/datacatalog/deployment.yaml +++ b/charts/flyte-core/templates/datacatalog/deployment.yaml @@ -38,6 +38,12 @@ spec: volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 8 }} - mountPath: /etc/datacatalog/config name: config-volume + {{- if .Values.datacatalog.podEnv }} + env: + {{- with .Values.datacatalog.podEnv }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} containers: - command: - datacatalog diff --git a/charts/flyte-core/templates/flytescheduler/deployment.yaml b/charts/flyte-core/templates/flytescheduler/deployment.yaml index fa5cfc4fd9..37b2394b1d 100755 --- a/charts/flyte-core/templates/flytescheduler/deployment.yaml +++ b/charts/flyte-core/templates/flytescheduler/deployment.yaml @@ -33,6 +33,12 @@ spec: - precheck - --config - {{ .Values.flytescheduler.configPath }} + {{- if .Values.flytescheduler.podEnv }} + env: + {{- with .Values.flytescheduler.podEnv -}} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} image: "{{ .Values.flytescheduler.image.repository }}:{{ .Values.flytescheduler.image.tag }}" imagePullPolicy: "{{ .Values.flytescheduler.image.pullPolicy }}" name: flytescheduler-check diff --git a/charts/flyte-core/templates/propeller/webhook.yaml b/charts/flyte-core/templates/propeller/webhook.yaml index 6d1ee7296b..f76f8b6213 100644 --- a/charts/flyte-core/templates/propeller/webhook.yaml +++ b/charts/flyte-core/templates/propeller/webhook.yaml @@ -61,6 +61,11 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + {{- if .Values.flytepropeller.podEnv -}} + {{- with .Values.flytepropeller.podEnv -}} + {{- toYaml . | nindent 10 }} + {{- end }} + {{- end }} volumeMounts: - name: config-volume mountPath: /etc/flyte/config diff --git a/deployment/eks/flyte_aws_scheduler_helm_generated.yaml b/deployment/eks/flyte_aws_scheduler_helm_generated.yaml index 1006ac92a7..ce920b2cd0 100644 --- a/deployment/eks/flyte_aws_scheduler_helm_generated.yaml +++ b/deployment/eks/flyte_aws_scheduler_helm_generated.yaml @@ -1096,7 +1096,6 @@ spec: name: flyte-console-config ports: - containerPort: 8080 - env: resources: limits: cpu: 250m diff --git a/deployment/eks/flyte_helm_controlplane_generated.yaml b/deployment/eks/flyte_helm_controlplane_generated.yaml index 18581603d1..983b6402cc 100644 --- a/deployment/eks/flyte_helm_controlplane_generated.yaml +++ b/deployment/eks/flyte_helm_controlplane_generated.yaml @@ -802,7 +802,6 @@ spec: name: flyte-console-config ports: - containerPort: 8080 - env: resources: limits: cpu: 250m diff --git a/deployment/eks/flyte_helm_generated.yaml b/deployment/eks/flyte_helm_generated.yaml index 2b7d54646e..6eda2a0546 100644 --- a/deployment/eks/flyte_helm_generated.yaml +++ b/deployment/eks/flyte_helm_generated.yaml @@ -1127,7 +1127,6 @@ spec: name: flyte-console-config ports: - containerPort: 8080 - env: resources: limits: cpu: 250m diff --git a/deployment/gcp/flyte_helm_controlplane_generated.yaml b/deployment/gcp/flyte_helm_controlplane_generated.yaml index c465136c26..b040ebafd5 100644 --- a/deployment/gcp/flyte_helm_controlplane_generated.yaml +++ b/deployment/gcp/flyte_helm_controlplane_generated.yaml @@ -817,7 +817,6 @@ spec: name: flyte-console-config ports: - containerPort: 8080 - env: resources: limits: cpu: 250m diff --git a/deployment/gcp/flyte_helm_generated.yaml b/deployment/gcp/flyte_helm_generated.yaml index 46348b01c7..dc1aa37a2e 100644 --- a/deployment/gcp/flyte_helm_generated.yaml +++ b/deployment/gcp/flyte_helm_generated.yaml @@ -1150,7 +1150,6 @@ spec: name: flyte-console-config ports: - containerPort: 8080 - env: resources: limits: cpu: 250m