Skip to content

Commit

Permalink
Flyte-core add missing podEnv values (#4807)
Browse files Browse the repository at this point in the history
* Flyte-core add missing podEnv values

 - In #4756 / fb9ffd5, 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 <[email protected]>

* 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 <[email protected]>

---------

Signed-off-by: ddl-ebrown <[email protected]>
  • Loading branch information
ddl-ebrown authored Feb 6, 2024
1 parent 5e00e7b commit b7d8492
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 5 deletions.
21 changes: 21 additions & 0 deletions charts/flyte-core/templates/admin/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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 }}"
Expand All @@ -96,6 +114,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- with .Values.flyteadmin.env -}}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
containers:
- command:
- flyteadmin
Expand Down
2 changes: 2 additions & 0 deletions charts/flyte-core/templates/console/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
6 changes: 6 additions & 0 deletions charts/flyte-core/templates/datacatalog/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions charts/flyte-core/templates/flytescheduler/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions charts/flyte-core/templates/propeller/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion deployment/eks/flyte_aws_scheduler_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,6 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down
1 change: 0 additions & 1 deletion deployment/eks/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,6 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down
1 change: 0 additions & 1 deletion deployment/eks/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,6 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down
1 change: 0 additions & 1 deletion deployment/gcp/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,6 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down
1 change: 0 additions & 1 deletion deployment/gcp/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,6 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down

0 comments on commit b7d8492

Please sign in to comment.