Skip to content

Commit

Permalink
Add flyte-core Helm support for podEnv
Browse files Browse the repository at this point in the history
 - podEnv is a standard Helm addition used to add additional environment
   variables to pods

 - NOTE: flyteadmin already defined a `env: []`, so no podEnv was added
   there was it would be a breaking change

Signed-off-by: ddl-ebrown <[email protected]>
  • Loading branch information
ddl-ebrown committed Jan 23, 2024
1 parent a55e47a commit b77c0f6
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 3 deletions.
7 changes: 6 additions & 1 deletion charts/flyte-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ helm install gateway bitnami/contour -n flyte
| cloud_events.eventsPublisher.eventTypes[0] | string | `"all"` | |
| cloud_events.eventsPublisher.topicName | string | `"arn:aws:sns:us-east-2:123456:123-my-topic"` | |
| cloud_events.type | string | `"aws"` | |
| cluster_resource_manager | object | `{"config":{"cluster_resources":{"customData":[{"production":[{"projectQuotaCpu":{"value":"5"}},{"projectQuotaMemory":{"value":"4000Mi"}}]},{"staging":[{"projectQuotaCpu":{"value":"2"}},{"projectQuotaMemory":{"value":"3000Mi"}}]},{"development":[{"projectQuotaCpu":{"value":"4"}},{"projectQuotaMemory":{"value":"3000Mi"}}]}],"refreshInterval":"5m","standaloneDeployment":false,"templatePath":"/etc/flyte/clusterresource/templates"}},"enabled":true,"podAnnotations":{},"podLabels":{},"service_account_name":"flyteadmin","standaloneDeployment":false,"templates":[{"key":"aa_namespace","value":"apiVersion: v1\nkind: Namespace\nmetadata:\n name: {{ namespace }}\nspec:\n finalizers:\n - kubernetes\n"},{"key":"ab_project_resource_quota","value":"apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: project-quota\n namespace: {{ namespace }}\nspec:\n hard:\n limits.cpu: {{ projectQuotaCpu }}\n limits.memory: {{ projectQuotaMemory }}\n"}]}` | Configuration for the Cluster resource manager component. This is an optional component, that enables automatic cluster configuration. This is useful to set default quotas, manage namespaces etc that map to a project/domain |
| cluster_resource_manager | object | `{"config":{"cluster_resources":{"customData":[{"production":[{"projectQuotaCpu":{"value":"5"}},{"projectQuotaMemory":{"value":"4000Mi"}}]},{"staging":[{"projectQuotaCpu":{"value":"2"}},{"projectQuotaMemory":{"value":"3000Mi"}}]},{"development":[{"projectQuotaCpu":{"value":"4"}},{"projectQuotaMemory":{"value":"3000Mi"}}]}],"refreshInterval":"5m","standaloneDeployment":false,"templatePath":"/etc/flyte/clusterresource/templates"}},"enabled":true,"podAnnotations":{},"podEnv":{},"podLabels":{},"service_account_name":"flyteadmin","standaloneDeployment":false,"templates":[{"key":"aa_namespace","value":"apiVersion: v1\nkind: Namespace\nmetadata:\n name: {{ namespace }}\nspec:\n finalizers:\n - kubernetes\n"},{"key":"ab_project_resource_quota","value":"apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: project-quota\n namespace: {{ namespace }}\nspec:\n hard:\n limits.cpu: {{ projectQuotaCpu }}\n limits.memory: {{ projectQuotaMemory }}\n"}]}` | Configuration for the Cluster resource manager component. This is an optional component, that enables automatic cluster configuration. This is useful to set default quotas, manage namespaces etc that map to a project/domain |
| cluster_resource_manager.config | object | `{"cluster_resources":{"customData":[{"production":[{"projectQuotaCpu":{"value":"5"}},{"projectQuotaMemory":{"value":"4000Mi"}}]},{"staging":[{"projectQuotaCpu":{"value":"2"}},{"projectQuotaMemory":{"value":"3000Mi"}}]},{"development":[{"projectQuotaCpu":{"value":"4"}},{"projectQuotaMemory":{"value":"3000Mi"}}]}],"refreshInterval":"5m","standaloneDeployment":false,"templatePath":"/etc/flyte/clusterresource/templates"}}` | Configmap for ClusterResource parameters |
| cluster_resource_manager.config.cluster_resources | object | `{"customData":[{"production":[{"projectQuotaCpu":{"value":"5"}},{"projectQuotaMemory":{"value":"4000Mi"}}]},{"staging":[{"projectQuotaCpu":{"value":"2"}},{"projectQuotaMemory":{"value":"3000Mi"}}]},{"development":[{"projectQuotaCpu":{"value":"4"}},{"projectQuotaMemory":{"value":"3000Mi"}}]}],"refreshInterval":"5m","standaloneDeployment":false,"templatePath":"/etc/flyte/clusterresource/templates"}` | ClusterResource parameters Refer to the [structure](https://pkg.go.dev/github.com/lyft/[email protected]/pkg/runtime/interfaces#ClusterResourceConfig) to customize. |
| cluster_resource_manager.config.cluster_resources.refreshInterval | string | `"5m"` | How frequently to run the sync process |
| cluster_resource_manager.config.cluster_resources.standaloneDeployment | bool | `false` | Starts the cluster resource manager in standalone mode with requisite auth credentials to call flyteadmin service endpoints |
| cluster_resource_manager.enabled | bool | `true` | Enables the Cluster resource manager component |
| cluster_resource_manager.podAnnotations | object | `{}` | Annotations for ClusterResource pods |
| cluster_resource_manager.podEnv | object | `{}` | Additional ClusterResource container environment variables |
| cluster_resource_manager.podLabels | object | `{}` | Labels for ClusterResource pods |
| cluster_resource_manager.service_account_name | string | `"flyteadmin"` | Service account name to run with |
| cluster_resource_manager.templates | list | `[{"key":"aa_namespace","value":"apiVersion: v1\nkind: Namespace\nmetadata:\n name: {{ namespace }}\nspec:\n finalizers:\n - kubernetes\n"},{"key":"ab_project_resource_quota","value":"apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: project-quota\n namespace: {{ namespace }}\nspec:\n hard:\n limits.cpu: {{ projectQuotaCpu }}\n limits.memory: {{ projectQuotaMemory }}\n"}]` | Resource templates that should be applied |
Expand Down Expand Up @@ -129,6 +130,7 @@ helm install gateway bitnami/contour -n flyte
| datacatalog.image.tag | string | `"v1.10.7-b1"` | Docker image tag |
| datacatalog.nodeSelector | object | `{}` | nodeSelector for Datacatalog deployment |
| datacatalog.podAnnotations | object | `{}` | Annotations for Datacatalog pods |
| datacatalog.podEnv | object | `{}` | Additional Datacatalog container environment variables |
| datacatalog.podLabels | object | `{}` | Labels for Datacatalog pods |
| datacatalog.priorityClassName | string | `""` | Sets priorityClassName for datacatalog pod(s). |
| datacatalog.replicaCount | int | `1` | Replicas count for Datacatalog deployment |
Expand Down Expand Up @@ -195,6 +197,7 @@ helm install gateway bitnami/contour -n flyte
| flyteconsole.image.tag | string | `"v1.10.2"` | |
| flyteconsole.nodeSelector | object | `{}` | nodeSelector for Flyteconsole deployment |
| flyteconsole.podAnnotations | object | `{}` | Annotations for Flyteconsole pods |
| flyteconsole.podEnv | object | `{}` | Additional Flyteconsole container environment variables |
| flyteconsole.podLabels | object | `{}` | Labels for Flyteconsole pods |
| flyteconsole.priorityClassName | string | `""` | Sets priorityClassName for flyte console pod(s). |
| flyteconsole.replicaCount | int | `1` | Replicas count for Flyteconsole deployment |
Expand All @@ -217,6 +220,7 @@ helm install gateway bitnami/contour -n flyte
| flytepropeller.manager | bool | `false` | |
| flytepropeller.nodeSelector | object | `{}` | nodeSelector for Flytepropeller deployment |
| flytepropeller.podAnnotations | object | `{}` | Annotations for Flytepropeller pods |
| flytepropeller.podEnv | object | `{}` | Additional Flytepropeller container environment variables |
| flytepropeller.podLabels | object | `{}` | Labels for Flytepropeller pods |
| flytepropeller.priorityClassName | string | `""` | Sets priorityClassName for propeller pod(s). |
| flytepropeller.replicaCount | int | `1` | Replicas count for Flytepropeller deployment |
Expand Down Expand Up @@ -244,6 +248,7 @@ helm install gateway bitnami/contour -n flyte
| flytescheduler.image.tag | string | `"v1.10.7-b1"` | Docker image tag |
| flytescheduler.nodeSelector | object | `{}` | nodeSelector for Flytescheduler deployment |
| flytescheduler.podAnnotations | object | `{}` | Annotations for Flytescheduler pods |
| flytescheduler.podEnv | object | `{}` | Additional Flytescheduler container environment variables |
| flytescheduler.podLabels | object | `{}` | Labels for Flytescheduler pods |
| flytescheduler.priorityClassName | string | `""` | Sets priorityClassName for flyte scheduler pod(s). |
| flytescheduler.resources | object | `{"limits":{"cpu":"250m","ephemeral-storage":"100Mi","memory":"500Mi"},"requests":{"cpu":"10m","ephemeral-storage":"50Mi","memory":"50Mi"}}` | Default resources requests and limits for Flytescheduler deployment |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ spec:
- {{ .Values.flyteadmin.configPath }}
- clusterresource
- run
{{- if .Values.cluster_resource_manager.podEnv }}
env:
{{- with .Values.cluster_resource_manager.podEnv }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
image: "{{ .Values.flyteadmin.image.repository }}:{{ .Values.flyteadmin.image.tag }}"
imagePullPolicy: "{{ .Values.flyteadmin.image.pullPolicy }}"
name: sync-cluster-resources
Expand Down
7 changes: 6 additions & 1 deletion charts/flyte-core/templates/console/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
{{- if .Values.flyteconsole.ga.enabled }}
env:
{{- if .Values.flyteconsole.ga.enabled }}
- name: ENABLE_GA
value: "{{ .Values.flyteconsole.ga.enabled }}"
- name: GA_TRACKING_ID
value: "{{ .Values.flyteconsole.ga.tracking_id }}"
{{- end }}
{{- if .Values.flyteconsole.podEnv -}}
{{- with .Values.flyteconsole.podEnv }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
resources: {{ toYaml .Values.flyteconsole.resources | nindent 10 }}
volumeMounts:
- mountPath: /srv/flyte
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 @@ -47,6 +47,12 @@ spec:
{{- with .Values.datacatalog.extraArgs }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- if .Values.datacatalog.podEnv }}
env:
{{- with .Values.datacatalog.podEnv }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
image: "{{ .Values.datacatalog.image.repository }}:{{ .Values.datacatalog.image.tag }}"
imagePullPolicy: "{{ .Values.datacatalog.image.pullPolicy }}"
name: 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 @@ -48,6 +48,12 @@ spec:
- run
- --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
Expand Down
5 changes: 5 additions & 0 deletions charts/flyte-core/templates/propeller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.flytepropeller.podEnv -}}
{{- with .Values.flytepropeller.podEnv -}}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
image: "{{ .Values.flytepropeller.image.repository }}:{{ .Values.flytepropeller.image.tag }}"
imagePullPolicy: "{{ .Values.flytepropeller.image.pullPolicy }}"
{{- if .Values.flytepropeller.manager }}
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 @@ -84,6 +84,11 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.flytepropeller.podEnv -}}
{{- with .Values.flytepropeller.podEnv -}}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
volumeMounts:
- name: config-volume
mountPath: /etc/flyte/config
Expand Down
12 changes: 11 additions & 1 deletion charts/flyte-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ flytescheduler:
imagePullSecrets: []
# -- Annotations for Flytescheduler pods
podAnnotations: {}
# -- Additional Flytescheduler container environment variables
podEnv: {}
# -- Labels for Flytescheduler pods
podLabels: {}
# -- nodeSelector for Flytescheduler deployment
Expand Down Expand Up @@ -220,6 +222,8 @@ datacatalog:
imagePullSecrets: []
# -- Annotations for Datacatalog pods
podAnnotations: {}
# -- Additional Datacatalog container environment variables
podEnv: {}
# -- Labels for Datacatalog pods
podLabels: {}
# -- nodeSelector for Datacatalog deployment
Expand Down Expand Up @@ -288,6 +292,8 @@ flytepropeller:
imagePullSecrets: []
# -- Annotations for Flytepropeller pods
podAnnotations: {}
# -- Additional Flytepropeller container environment variables
podEnv: {}
# -- Labels for Flytepropeller pods
podLabels: {}
# -- nodeSelector for Flytepropeller deployment
Expand Down Expand Up @@ -352,6 +358,8 @@ flyteconsole:
type: ClusterIP
# -- Annotations for Flyteconsole pods
podAnnotations: {}
# -- Additional Flyteconsole container environment variables
podEnv: {}
# -- Labels for Flyteconsole pods
podLabels: {}
# -- nodeSelector for Flyteconsole deployment
Expand Down Expand Up @@ -581,7 +589,7 @@ configmap:
eventVersion: 2
testing:
host: http://flyteadmin

# -- Authentication configuration
auth:
authorizedUris:
Expand Down Expand Up @@ -834,6 +842,8 @@ cluster_resource_manager:
service_account_name: flyteadmin
# -- Annotations for ClusterResource pods
podAnnotations: {}
# -- Additional ClusterResource container environment variables
podEnv: {}
# -- Labels for ClusterResource pods
podLabels: {}
# -- Configmap for ClusterResource parameters
Expand Down
1 change: 1 addition & 0 deletions charts/flyteagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ A Helm chart for Flyte agent
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | nodeSelector for flyteagent deployment |
| podAnnotations | object | `{}` | Annotations for flyteagent pods |
| podEnv | object | `{}` | Additional flyteagent pod container environment variables |
| podLabels | object | `{}` | Labels for flyteagent pods |
| ports.containerPort | int | `8000` | |
| ports.name | string | `"agent-grpc"` | |
Expand Down
6 changes: 6 additions & 0 deletions charts/flyteagent/templates/agent/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ spec:
- command:
- pyflyte
- serve
{{- if .Values.podEnv }}
env:
{{- with .Values.podEnv }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
name: flyteagent
Expand Down
2 changes: 2 additions & 0 deletions charts/flyteagent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ serviceAccount:
imagePullSecrets: []
# -- Annotations for flyteagent pods
podAnnotations: {}
# -- Additional flyteagent pod container environment variables
podEnv: {}
# -- Labels for flyteagent pods
podLabels: {}
# -- nodeSelector for flyteagent deployment
Expand Down
1 change: 1 addition & 0 deletions deployment/eks/flyte_aws_scheduler_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,7 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down
1 change: 1 addition & 0 deletions deployment/eks/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down
1 change: 1 addition & 0 deletions deployment/eks/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down
1 change: 1 addition & 0 deletions deployment/gcp/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down
1 change: 1 addition & 0 deletions deployment/gcp/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,7 @@ spec:
name: flyte-console-config
ports:
- containerPort: 8080
env:
resources:
limits:
cpu: 250m
Expand Down

0 comments on commit b77c0f6

Please sign in to comment.