Skip to content

Commit

Permalink
Add Helm support for podLabels
Browse files Browse the repository at this point in the history
Signed-off-by: ddl-ebrown <[email protected]>
  • Loading branch information
ddl-ebrown committed Jan 22, 2024
1 parent 0123e73 commit 36bf642
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 11 deletions.
8 changes: 7 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":{},"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/[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.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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand All @@ -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 |
Expand All @@ -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 |
Expand Down
56 changes: 56 additions & 0 deletions charts/flyte-core/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand All @@ -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 -}}
Expand All @@ -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 -}}
Expand All @@ -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 -}}
Expand All @@ -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 -}}
Expand All @@ -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 -}}
Expand All @@ -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 -}}
Expand All @@ -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" -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/flyte-core/templates/admin/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/flyte-core/templates/console/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/flyte-core/templates/datacatalog/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/flyte-core/templates/flytescheduler/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/flyte-core/templates/propeller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions charts/flyte-core/templates/propeller/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
14 changes: 13 additions & 1 deletion charts/flyte-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ flyteadmin:
- '*'
# -- Annotations for Flyteadmin pods
podAnnotations: {}
# -- Labels for Flyteadmin pods
podLabels: {}
# -- nodeSelector for Flyteadmin deployment
nodeSelector: {}
# -- tolerations for Flyteadmin deployment
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -922,4 +934,4 @@ databricks:
databricks:
entrypointFile: dbfs:///FileStore/tables/entrypoint.py
# Databricks account
databricksInstance: dbc-a53b7a3c-614c
databricksInstance: dbc-a53b7a3c-614c
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 |
| podLabels | object | `{}` | Labels for flyteagent pods |
| ports.containerPort | int | `8000` | |
| ports.name | string | `"agent-grpc"` | |
| priorityClassName | string | `""` | Sets priorityClassName for datacatalog pod(s). |
Expand Down
9 changes: 8 additions & 1 deletion charts/flyteagent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" -}}
Expand All @@ -43,4 +50,4 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}

{{- define "flyteagent.servicePort" -}}
{{ include .Values.ports.containerPort}}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/flyteagent/templates/agent/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
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: {}
# -- Labels for flyteagent pods
podLabels: {}
# -- nodeSelector for flyteagent deployment
nodeSelector: {}
# -- tolerations for flyteagent deployment
Expand Down

0 comments on commit 36bf642

Please sign in to comment.