From 0123e73bda3c52dd5c64581cf9417823c7033033 Mon Sep 17 00:00:00 2001 From: ddl-ebrown Date: Mon, 22 Jan 2024 06:50:25 -0800 Subject: [PATCH 1/3] Fix webhook typo Signed-off-by: ddl-ebrown --- charts/flyte-core/templates/propeller/webhook.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/flyte-core/templates/propeller/webhook.yaml b/charts/flyte-core/templates/propeller/webhook.yaml index 2934bfcf21..c6a21f9976 100644 --- a/charts/flyte-core/templates/propeller/webhook.yaml +++ b/charts/flyte-core/templates/propeller/webhook.yaml @@ -28,7 +28,7 @@ spec: app.kubernetes.io/version: {{ .Values.flytepropeller.image.tag }} annotations: configChecksum: {{ include (print .Template.BasePath "/propeller/configmap.yaml") . | sha256sum | trunc 63 | quote }} - {{- with .Values.flyteadmin.podAnnotations }} + {{- with .Values.flytepropeller.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -60,7 +60,7 @@ spec: fieldPath: metadata.namespace volumeMounts: - name: config-volume - mountPath: /etc/flyte/config + mountPath: /etc/flyte/config {{- end }} containers: - name: webhook From e6e69cd98aff677cb22415605d782b05d88f2100 Mon Sep 17 00:00:00 2001 From: ddl-ebrown Date: Mon, 22 Jan 2024 06:55:15 -0800 Subject: [PATCH 2/3] Add flyte-core Helm support for podLabels - podLabels is a standard pod value often needed to introduce user-customizable labels to pods Signed-off-by: ddl-ebrown --- charts/flyte-core/README.md | 8 ++- charts/flyte-core/templates/_helpers.tpl | 56 +++++++++++++++++++ .../templates/admin/deployment.yaml | 2 +- .../clusterresourcesync/deployment.yaml | 2 +- .../templates/console/deployment.yaml | 2 +- .../templates/datacatalog/deployment.yaml | 2 +- .../templates/flytescheduler/deployment.yaml | 2 +- .../templates/propeller/deployment.yaml | 4 +- .../templates/propeller/webhook.yaml | 3 + charts/flyte-core/values.yaml | 14 ++++- charts/flyteagent/README.md | 1 + charts/flyteagent/templates/_helpers.tpl | 9 ++- .../templates/agent/deployment.yaml | 2 +- charts/flyteagent/values.yaml | 2 + 14 files changed, 98 insertions(+), 11 deletions(-) diff --git a/charts/flyte-core/README.md b/charts/flyte-core/README.md index fecd58959f..25170c2a44 100644 --- a/charts/flyte-core/README.md +++ b/charts/flyte-core/README.md @@ -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":{},"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":{},"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/flyteadmin@v0.3.37/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.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 | | cluster_resource_manager.templates[0] | object | `{"key":"aa_namespace","value":"apiVersion: v1\nkind: Namespace\nmetadata:\n name: {{ namespace }}\nspec:\n finalizers:\n - kubernetes\n"}` | Template for namespaces resources | @@ -128,6 +129,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.podLabels | object | `{}` | Labels for Datacatalog pods | | datacatalog.priorityClassName | string | `""` | Sets priorityClassName for datacatalog pod(s). | | datacatalog.replicaCount | int | `1` | Replicas count for Datacatalog deployment | | datacatalog.resources | object | `{"limits":{"cpu":"500m","ephemeral-storage":"100Mi","memory":"500Mi"},"requests":{"cpu":"10m","ephemeral-storage":"50Mi","memory":"50Mi"}}` | Default resources requests and limits for Datacatalog deployment | @@ -161,6 +163,7 @@ helm install gateway bitnami/contour -n flyte | flyteadmin.initialProjects | list | `["flytesnacks","flytetester","flyteexamples"]` | Initial projects to create | | flyteadmin.nodeSelector | object | `{}` | nodeSelector for Flyteadmin deployment | | flyteadmin.podAnnotations | object | `{}` | Annotations for Flyteadmin pods | +| flyteadmin.podLabels | object | `{}` | Labels for Flyteadmin pods | | flyteadmin.priorityClassName | string | `""` | Sets priorityClassName for flyteadmin pod(s). | | flyteadmin.replicaCount | int | `1` | Replicas count for Flyteadmin deployment | | flyteadmin.resources | object | `{"limits":{"cpu":"250m","ephemeral-storage":"100Mi","memory":"500Mi"},"requests":{"cpu":"10m","ephemeral-storage":"50Mi","memory":"50Mi"}}` | Default resources requests and limits for Flyteadmin deployment | @@ -192,6 +195,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.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 | | flyteconsole.resources | object | `{"limits":{"cpu":"500m","memory":"250Mi"},"requests":{"cpu":"10m","memory":"50Mi"}}` | Default resources requests and limits for Flyteconsole deployment | @@ -213,6 +217,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.podLabels | object | `{}` | Labels for Flytepropeller pods | | flytepropeller.priorityClassName | string | `""` | Sets priorityClassName for propeller pod(s). | | flytepropeller.replicaCount | int | `1` | Replicas count for Flytepropeller deployment | | flytepropeller.resources | object | `{"limits":{"cpu":"200m","ephemeral-storage":"100Mi","memory":"200Mi"},"requests":{"cpu":"10m","ephemeral-storage":"50Mi","memory":"100Mi"}}` | Default resources requests and limits for Flytepropeller deployment | @@ -239,6 +244,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.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 | | flytescheduler.runPrecheck | bool | `true` | Whether to inject an init container which waits on flyteadmin | diff --git a/charts/flyte-core/templates/_helpers.tpl b/charts/flyte-core/templates/_helpers.tpl index 0221874d5c..2c3b059841 100755 --- a/charts/flyte-core/templates/_helpers.tpl +++ b/charts/flyte-core/templates/_helpers.tpl @@ -28,6 +28,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "flyteadmin.podLabels" -}} +{{ include "flyteadmin.labels" . }} +{{- with .Values.flyteadmin.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + {{- define "flytescheduler.name" -}} flytescheduler {{- end -}} @@ -44,6 +51,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "flytescheduler.podLabels" -}} +{{ include "flytescheduler.labels" . }} +{{- with .Values.flytescheduler.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + {{- define "flyteclusterresourcesync.name" -}} flyteclusterresourcesync {{- end -}} @@ -59,6 +73,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "flyteclusterresourcesync.podLabels" -}} +{{ include "flyteclusterresourcesync.labels" . }} +{{- with .Values.cluster_resource_manager.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + {{- define "datacatalog.name" -}} datacatalog {{- end -}} @@ -74,6 +95,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "datacatalog.podLabels" -}} +{{ include "datacatalog.labels" . }} +{{- with .Values.datacatalog.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + {{- define "flyteagent.name" -}} flyteagent {{- end -}} @@ -89,6 +117,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "flyteagent.podLabels" -}} +{{ include "flyteagent.labels" . }} +{{- with .Values.flyteagent.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + {{- define "flytepropeller.name" -}} flytepropeller {{- end -}} @@ -104,6 +139,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "flytepropeller.podLabels" -}} +{{ include "flytepropeller.labels" . }} +{{- with .Values.flytepropeller.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + {{- define "flytepropeller-manager.name" -}} flytepropeller-manager {{- end -}} @@ -119,6 +161,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "flytepropeller-manager.podLabels" -}} +{{ include "flytepropeller-manager.labels" . }} +{{- with .Values.flytepropeller.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + {{- define "flyte-pod-webhook.name" -}} flyte-pod-webhook {{- end -}} @@ -139,6 +188,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "flyteconsole.podLabels" -}} +{{ include "flyteconsole.labels" . }} +{{- with .Values.flyteconsole.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + # Optional blocks for secret mount {{- define "databaseSecret.volume" -}} diff --git a/charts/flyte-core/templates/admin/deployment.yaml b/charts/flyte-core/templates/admin/deployment.yaml index 8b6dff34af..5a081224a8 100755 --- a/charts/flyte-core/templates/admin/deployment.yaml +++ b/charts/flyte-core/templates/admin/deployment.yaml @@ -16,7 +16,7 @@ spec: {{- with .Values.flyteadmin.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - labels: {{ include "flyteadmin.labels" . | nindent 8 }} + labels: {{ include "flyteadmin.podLabels" . | nindent 8 }} spec: securityContext: fsGroup: 65534 diff --git a/charts/flyte-core/templates/clusterresourcesync/deployment.yaml b/charts/flyte-core/templates/clusterresourcesync/deployment.yaml index bf13c08080..c0dca8a7f7 100644 --- a/charts/flyte-core/templates/clusterresourcesync/deployment.yaml +++ b/charts/flyte-core/templates/clusterresourcesync/deployment.yaml @@ -16,7 +16,7 @@ spec: {{- with .Values.cluster_resource_manager.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - labels: {{ include "flyteclusterresourcesync.labels" . | nindent 8 }} + labels: {{ include "flyteclusterresourcesync.podLabels" . | nindent 8 }} spec: containers: - command: diff --git a/charts/flyte-core/templates/console/deployment.yaml b/charts/flyte-core/templates/console/deployment.yaml index 0c9a948f5f..7042c60f76 100644 --- a/charts/flyte-core/templates/console/deployment.yaml +++ b/charts/flyte-core/templates/console/deployment.yaml @@ -16,7 +16,7 @@ spec: {{- with .Values.flyteconsole.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - labels: {{ include "flyteconsole.labels" . | nindent 8 }} + labels: {{ include "flyteconsole.podLabels" . | nindent 8 }} spec: securityContext: runAsUser: 1000 diff --git a/charts/flyte-core/templates/datacatalog/deployment.yaml b/charts/flyte-core/templates/datacatalog/deployment.yaml index e9f2c84ec8..91a3b86ae6 100644 --- a/charts/flyte-core/templates/datacatalog/deployment.yaml +++ b/charts/flyte-core/templates/datacatalog/deployment.yaml @@ -16,7 +16,7 @@ spec: {{- with .Values.datacatalog.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - labels: {{ include "datacatalog.labels" . | nindent 8 }} + labels: {{ include "datacatalog.podLabels" . | nindent 8 }} spec: securityContext: fsGroup: 1001 diff --git a/charts/flyte-core/templates/flytescheduler/deployment.yaml b/charts/flyte-core/templates/flytescheduler/deployment.yaml index 443354efd7..2c15d744fa 100755 --- a/charts/flyte-core/templates/flytescheduler/deployment.yaml +++ b/charts/flyte-core/templates/flytescheduler/deployment.yaml @@ -17,7 +17,7 @@ spec: {{- with .Values.flytescheduler.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - labels: {{ include "flytescheduler.labels" . | nindent 8 }} + labels: {{ include "flytescheduler.podLabels" . | nindent 8 }} spec: securityContext: fsGroup: 65534 diff --git a/charts/flyte-core/templates/propeller/deployment.yaml b/charts/flyte-core/templates/propeller/deployment.yaml index 72f94fcc1b..da6e64da05 100644 --- a/charts/flyte-core/templates/propeller/deployment.yaml +++ b/charts/flyte-core/templates/propeller/deployment.yaml @@ -26,9 +26,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.flytepropeller.manager }} - labels: {{ include "flytepropeller-manager.labels" . | nindent 8 }} + labels: {{ include "flytepropeller-manager.podLabels" . | nindent 8 }} {{- else }} - labels: {{ include "flytepropeller.labels" . | nindent 8 }} + labels: {{ include "flytepropeller.podLabels" . | nindent 8 }} {{- end }} spec: securityContext: diff --git a/charts/flyte-core/templates/propeller/webhook.yaml b/charts/flyte-core/templates/propeller/webhook.yaml index c6a21f9976..30689f59b3 100644 --- a/charts/flyte-core/templates/propeller/webhook.yaml +++ b/charts/flyte-core/templates/propeller/webhook.yaml @@ -26,6 +26,9 @@ spec: app: {{ template "flyte-pod-webhook.name" . }} app.kubernetes.io/name: {{ template "flyte-pod-webhook.name" . }} app.kubernetes.io/version: {{ .Values.flytepropeller.image.tag }} + {{- with .Values.flytepropeller.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} annotations: configChecksum: {{ include (print .Template.BasePath "/propeller/configmap.yaml") . | sha256sum | trunc 63 | quote }} {{- with .Values.flytepropeller.podAnnotations }} diff --git a/charts/flyte-core/values.yaml b/charts/flyte-core/values.yaml index 6fdb777763..2abad8f971 100755 --- a/charts/flyte-core/values.yaml +++ b/charts/flyte-core/values.yaml @@ -92,6 +92,8 @@ flyteadmin: - '*' # -- Annotations for Flyteadmin pods podAnnotations: {} + # -- Labels for Flyteadmin pods + podLabels: {} # -- nodeSelector for Flyteadmin deployment nodeSelector: {} # -- tolerations for Flyteadmin deployment @@ -158,6 +160,8 @@ flytescheduler: imagePullSecrets: [] # -- Annotations for Flytescheduler pods podAnnotations: {} + # -- Labels for Flytescheduler pods + podLabels: {} # -- nodeSelector for Flytescheduler deployment nodeSelector: {} # -- tolerations for Flytescheduler deployment @@ -216,6 +220,8 @@ datacatalog: imagePullSecrets: [] # -- Annotations for Datacatalog pods podAnnotations: {} + # -- Labels for Datacatalog pods + podLabels: {} # -- nodeSelector for Datacatalog deployment nodeSelector: {} # -- tolerations for Datacatalog deployment @@ -282,6 +288,8 @@ flytepropeller: imagePullSecrets: [] # -- Annotations for Flytepropeller pods podAnnotations: {} + # -- Labels for Flytepropeller pods + podLabels: {} # -- nodeSelector for Flytepropeller deployment nodeSelector: {} # -- tolerations for Flytepropeller deployment @@ -344,6 +352,8 @@ flyteconsole: type: ClusterIP # -- Annotations for Flyteconsole pods podAnnotations: {} + # -- Labels for Flyteconsole pods + podLabels: {} # -- nodeSelector for Flyteconsole deployment nodeSelector: {} # -- tolerations for Flyteconsole deployment @@ -824,6 +834,8 @@ cluster_resource_manager: service_account_name: flyteadmin # -- Annotations for ClusterResource pods podAnnotations: {} + # -- Labels for ClusterResource pods + podLabels: {} # -- Configmap for ClusterResource parameters config: # -- ClusterResource parameters @@ -922,4 +934,4 @@ databricks: databricks: entrypointFile: dbfs:///FileStore/tables/entrypoint.py # Databricks account - databricksInstance: dbc-a53b7a3c-614c \ No newline at end of file + databricksInstance: dbc-a53b7a3c-614c diff --git a/charts/flyteagent/README.md b/charts/flyteagent/README.md index 80107d8e2b..f6bb9d44b0 100644 --- a/charts/flyteagent/README.md +++ b/charts/flyteagent/README.md @@ -24,6 +24,7 @@ A Helm chart for Flyte agent | nameOverride | string | `""` | | | nodeSelector | object | `{}` | nodeSelector for flyteagent deployment | | podAnnotations | object | `{}` | Annotations for flyteagent pods | +| podLabels | object | `{}` | Labels for flyteagent pods | | ports.containerPort | int | `8000` | | | ports.name | string | `"agent-grpc"` | | | priorityClassName | string | `""` | Sets priorityClassName for datacatalog pod(s). | diff --git a/charts/flyteagent/templates/_helpers.tpl b/charts/flyteagent/templates/_helpers.tpl index fffa18304a..40411a61b9 100755 --- a/charts/flyteagent/templates/_helpers.tpl +++ b/charts/flyteagent/templates/_helpers.tpl @@ -28,6 +28,13 @@ helm.sh/chart: {{ include "flyte.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{- define "flyteagent.podLabels" -}} +{{ include "flyteagent.labels" . }} +{{- with .Values.podLabels }} +{{- toYaml . }} +{{- end }} +{{- end -}} + # Optional blocks for secret mount {{- define "agentSecret.volume" -}} @@ -43,4 +50,4 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- define "flyteagent.servicePort" -}} {{ include .Values.ports.containerPort}} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/flyteagent/templates/agent/deployment.yaml b/charts/flyteagent/templates/agent/deployment.yaml index a8b7a3889e..3ab8b85a69 100644 --- a/charts/flyteagent/templates/agent/deployment.yaml +++ b/charts/flyteagent/templates/agent/deployment.yaml @@ -14,7 +14,7 @@ spec: {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - labels: {{ include "flyteagent.labels" . | nindent 8 }} + labels: {{ include "flyteagent.podLabels" . | nindent 8 }} spec: {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} diff --git a/charts/flyteagent/values.yaml b/charts/flyteagent/values.yaml index d1d7ac5cbf..7a118024a3 100755 --- a/charts/flyteagent/values.yaml +++ b/charts/flyteagent/values.yaml @@ -56,6 +56,8 @@ serviceAccount: imagePullSecrets: [] # -- Annotations for flyteagent pods podAnnotations: {} +# -- Labels for flyteagent pods +podLabels: {} # -- nodeSelector for flyteagent deployment nodeSelector: {} # -- tolerations for flyteagent deployment From 174dd91f95e41bf1e79c7648f7d8dbedd744ba53 Mon Sep 17 00:00:00 2001 From: ddl-ebrown Date: Mon, 22 Jan 2024 06:58:44 -0800 Subject: [PATCH 3/3] Add flyte-core Helm support for podEnv - 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 --- charts/flyte-core/README.md | 7 ++++++- .../templates/clusterresourcesync/deployment.yaml | 6 ++++++ charts/flyte-core/templates/console/deployment.yaml | 7 ++++++- .../flyte-core/templates/datacatalog/deployment.yaml | 6 ++++++ .../templates/flytescheduler/deployment.yaml | 6 ++++++ .../flyte-core/templates/propeller/deployment.yaml | 5 +++++ charts/flyte-core/templates/propeller/webhook.yaml | 5 +++++ charts/flyte-core/values.yaml | 12 +++++++++++- charts/flyteagent/README.md | 1 + charts/flyteagent/templates/agent/deployment.yaml | 6 ++++++ charts/flyteagent/values.yaml | 2 ++ .../eks/flyte_aws_scheduler_helm_generated.yaml | 1 + .../eks/flyte_helm_controlplane_generated.yaml | 1 + deployment/eks/flyte_helm_generated.yaml | 1 + .../gcp/flyte_helm_controlplane_generated.yaml | 1 + deployment/gcp/flyte_helm_generated.yaml | 1 + 16 files changed, 65 insertions(+), 3 deletions(-) diff --git a/charts/flyte-core/README.md b/charts/flyte-core/README.md index 25170c2a44..c0f1e76212 100644 --- a/charts/flyte-core/README.md +++ b/charts/flyte-core/README.md @@ -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/flyteadmin@v0.3.37/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 | @@ -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 | @@ -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 | @@ -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 | @@ -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 | diff --git a/charts/flyte-core/templates/clusterresourcesync/deployment.yaml b/charts/flyte-core/templates/clusterresourcesync/deployment.yaml index c0dca8a7f7..b4d4847c38 100644 --- a/charts/flyte-core/templates/clusterresourcesync/deployment.yaml +++ b/charts/flyte-core/templates/clusterresourcesync/deployment.yaml @@ -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 diff --git a/charts/flyte-core/templates/console/deployment.yaml b/charts/flyte-core/templates/console/deployment.yaml index 7042c60f76..09c9e741c8 100644 --- a/charts/flyte-core/templates/console/deployment.yaml +++ b/charts/flyte-core/templates/console/deployment.yaml @@ -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 diff --git a/charts/flyte-core/templates/datacatalog/deployment.yaml b/charts/flyte-core/templates/datacatalog/deployment.yaml index 91a3b86ae6..72c18ac61b 100644 --- a/charts/flyte-core/templates/datacatalog/deployment.yaml +++ b/charts/flyte-core/templates/datacatalog/deployment.yaml @@ -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 diff --git a/charts/flyte-core/templates/flytescheduler/deployment.yaml b/charts/flyte-core/templates/flytescheduler/deployment.yaml index 2c15d744fa..fa5cfc4fd9 100755 --- a/charts/flyte-core/templates/flytescheduler/deployment.yaml +++ b/charts/flyte-core/templates/flytescheduler/deployment.yaml @@ -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 diff --git a/charts/flyte-core/templates/propeller/deployment.yaml b/charts/flyte-core/templates/propeller/deployment.yaml index da6e64da05..0efb3b5dc9 100644 --- a/charts/flyte-core/templates/propeller/deployment.yaml +++ b/charts/flyte-core/templates/propeller/deployment.yaml @@ -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 }} diff --git a/charts/flyte-core/templates/propeller/webhook.yaml b/charts/flyte-core/templates/propeller/webhook.yaml index 30689f59b3..75866a8c2b 100644 --- a/charts/flyte-core/templates/propeller/webhook.yaml +++ b/charts/flyte-core/templates/propeller/webhook.yaml @@ -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 diff --git a/charts/flyte-core/values.yaml b/charts/flyte-core/values.yaml index 2abad8f971..ca80e9218a 100755 --- a/charts/flyte-core/values.yaml +++ b/charts/flyte-core/values.yaml @@ -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 @@ -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 @@ -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 @@ -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 @@ -581,7 +589,7 @@ configmap: eventVersion: 2 testing: host: http://flyteadmin - + # -- Authentication configuration auth: authorizedUris: @@ -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 diff --git a/charts/flyteagent/README.md b/charts/flyteagent/README.md index f6bb9d44b0..9db05060d0 100644 --- a/charts/flyteagent/README.md +++ b/charts/flyteagent/README.md @@ -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"` | | diff --git a/charts/flyteagent/templates/agent/deployment.yaml b/charts/flyteagent/templates/agent/deployment.yaml index 3ab8b85a69..82359cec64 100644 --- a/charts/flyteagent/templates/agent/deployment.yaml +++ b/charts/flyteagent/templates/agent/deployment.yaml @@ -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 diff --git a/charts/flyteagent/values.yaml b/charts/flyteagent/values.yaml index 7a118024a3..b682600d46 100755 --- a/charts/flyteagent/values.yaml +++ b/charts/flyteagent/values.yaml @@ -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 diff --git a/deployment/eks/flyte_aws_scheduler_helm_generated.yaml b/deployment/eks/flyte_aws_scheduler_helm_generated.yaml index 05fd72bdca..5643f07f8e 100644 --- a/deployment/eks/flyte_aws_scheduler_helm_generated.yaml +++ b/deployment/eks/flyte_aws_scheduler_helm_generated.yaml @@ -1094,6 +1094,7 @@ 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 4eaea054ab..d2e948109c 100644 --- a/deployment/eks/flyte_helm_controlplane_generated.yaml +++ b/deployment/eks/flyte_helm_controlplane_generated.yaml @@ -800,6 +800,7 @@ 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 c198baf1a0..8bb21ae017 100644 --- a/deployment/eks/flyte_helm_generated.yaml +++ b/deployment/eks/flyte_helm_generated.yaml @@ -1125,6 +1125,7 @@ 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 afb124e36a..d325bbb594 100644 --- a/deployment/gcp/flyte_helm_controlplane_generated.yaml +++ b/deployment/gcp/flyte_helm_controlplane_generated.yaml @@ -815,6 +815,7 @@ 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 6e47caa492..a14ca0b161 100644 --- a/deployment/gcp/flyte_helm_generated.yaml +++ b/deployment/gcp/flyte_helm_generated.yaml @@ -1148,6 +1148,7 @@ spec: name: flyte-console-config ports: - containerPort: 8080 + env: resources: limits: cpu: 250m