Skip to content

Commit

Permalink
Fixes for flyte-core helm chart to allow deploying cluster resource s…
Browse files Browse the repository at this point in the history
…ync as a standalone process (#2105)

* ch ch changes

Signed-off-by: Katrina Rogan <[email protected]>

* changelog

Signed-off-by: Katrina Rogan <[email protected]>

* more gen

Signed-off-by: Katrina Rogan <[email protected]>

* Can she bash?

Signed-off-by: Katrina Rogan <[email protected]>

* fun stuff

Signed-off-by: Katrina Rogan <[email protected]>

* ugh

Signed-off-by: Katrina Rogan <[email protected]>

* meow

Signed-off-by: Katrina Rogan <[email protected]>

* try again?

Signed-off-by: Katrina Rogan <[email protected]>

* progress

Signed-off-by: Katrina Rogan <[email protected]>

* try, try again

Signed-off-by: Katrina Rogan <[email protected]>

* tings

Signed-off-by: Katrina Rogan <[email protected]>

* okay nvm

Signed-off-by: Katrina Rogan <[email protected]>

* fix upgrade test sandbox in helm e2e

Signed-off-by: Yuvraj <[email protected]>

* debug test workflow

Signed-off-by: Yuvraj <[email protected]>

* make helm

Signed-off-by: Yuvraj <[email protected]>

* revert

Signed-off-by: Katrina Rogan <[email protected]>

* revert test GH workflow

Signed-off-by: Katrina Rogan <[email protected]>

Co-authored-by: Yuvraj <[email protected]>
  • Loading branch information
Katrina Rogan and yindia authored Jan 28, 2022
1 parent 94327d6 commit e980b77
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 62 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG/CHANGELOG-v0.19.2-b4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 0.19.2-b4 Release ChangeLog

## System
1. Additions to flyte-core helm chart to allow deploying cluster resource sync as a standalone process with the latest image version.
13 changes: 7 additions & 6 deletions charts/flyte-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ helm install gateway bitnami/contour -n flyte

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| 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"}}]}],"refresh":"5m","refreshInterval":"5m","templatePath":"/etc/flyte/clusterresource/templates"}},"enabled":true,"standalone_deploy":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"}}]}],"refresh":"5m","refreshInterval":"5m","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"}}]}],"refresh":"5m","refreshInterval":"5m","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 | 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"}}]}],"refresh":"5m","refreshInterval":"5m","standaloneDeployment":false,"templatePath":"/etc/flyte/clusterresource/templates"}},"enabled":true,"service_account_name":"flyteadmin","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"}}]}],"refresh":"5m","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"}}]}],"refresh":"5m","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.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.standalone_deploy | bool | `false` | Starts the cluster resource manager in standalone mode with requisite auth credentials to call flyteadmin service endpoints |
| 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 |
| common | object | `{"databaseSecret":{"name":"","secretManifest":{}},"flyteNamespaceTemplate":{"enabled":false},"ingress":{"albSSLRedirect":false,"annotations":{"nginx.ingress.kubernetes.io/app-root":"/console"},"enabled":true,"separateGrpcIngress":false,"separateGrpcIngressAnnotations":{"nginx.ingress.kubernetes.io/backend-protocol":"GRPC"},"tls":{"enabled":false},"webpackHMR":false}}` | ---------------------------------------------- COMMON SETTINGS |
Expand Down Expand Up @@ -132,7 +133,7 @@ helm install gateway bitnami/contour -n flyte
| flyteadmin.enabled | bool | `true` | |
| flyteadmin.image.pullPolicy | string | `"IfNotPresent"` | |
| flyteadmin.image.repository | string | `"cr.flyte.org/flyteorg/flyteadmin"` | Docker image for Flyteadmin deployment |
| flyteadmin.image.tag | string | `"v0.6.83"` | |
| flyteadmin.image.tag | string | `"v0.6.89"` | |
| flyteadmin.initialProjects | list | `["flytesnacks","flytetester","flyteexamples"]` | Initial projects to create |
| flyteadmin.nodeSelector | object | `{}` | nodeSelector for Flyteadmin deployment |
| flyteadmin.podAnnotations | object | `{}` | Annotations for Flyteadmin pods |
Expand Down Expand Up @@ -180,7 +181,7 @@ helm install gateway bitnami/contour -n flyte
| flytescheduler.configPath | string | `"/etc/flyte/config/*.yaml"` | Default regex string for searching configuration files |
| flytescheduler.image.pullPolicy | string | `"IfNotPresent"` | Docker image pull policy |
| flytescheduler.image.repository | string | `"cr.flyte.org/flyteorg/flytescheduler"` | Docker image for Flytescheduler deployment |
| flytescheduler.image.tag | string | `"v0.6.83"` | Docker image tag |
| flytescheduler.image.tag | string | `"v0.6.89"` | Docker image tag |
| flytescheduler.nodeSelector | object | `{}` | nodeSelector for Flytescheduler deployment |
| flytescheduler.podAnnotations | object | `{}` | Annotations for Flytescheduler pods |
| 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
@@ -1,4 +1,3 @@
{{- if .Values.flyteadmin.enabled }}
{{- if .Values.cluster_resource_manager.enabled }}
apiVersion: v1
kind: ConfigMap
Expand All @@ -10,5 +9,5 @@ data:
{{- range .Values.cluster_resource_manager.templates }}
{{ .key }}.yaml: | {{ .value | nindent 4 }}
{{- end }}
{{- end }}

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ data:
cluster_resources.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}

{{- if .Values.cluster_resource_manager.standalone_deploy }}
{{- if .Values.cluster_resource_manager.config.cluster_resources.standaloneDeployment }}
{{- with .Values.configmap.admin }}
admin.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- end }}

{{- if not .Values.cluster_resource_manager.standalone_deploy }}
{{- else }}
{{- with .Values.db.admin }}
db.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
Expand Down
6 changes: 2 additions & 4 deletions charts/flyte-core/templates/clusterresourcesync/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if .Values.flyteadmin.enabled }}
{{- if .Values.cluster_resource_manager.enabled }}
apiVersion: batch/v1beta1
kind: CronJob
Expand Down Expand Up @@ -27,15 +26,15 @@ spec:
imagePullPolicy: "{{ .Values.flyteadmin.image.pullPolicy }}"
name: sync-cluster-resources
volumeMounts:
{{- if not .Values.cluster_resource_manager.standalone_deploy}}
{{- if not .Values.cluster_resource_manager.config.cluster_resources.standaloneDeployment }}
{{- include "databaseSecret.volumeMount" . | nindent 12 }}
{{- end }}
- mountPath: /etc/flyte/clusterresource/templates
name: resource-templates
- mountPath: /etc/flyte/config
name: config-volume
restartPolicy: OnFailure
serviceAccountName: flyteadmin
serviceAccountName: {{ .Values.cluster_resource_manager.service_account_name }}
volumes: {{- include "databaseSecret.volume" . | nindent 10 }}
- configMap:
name: clusterresource-template
Expand All @@ -44,4 +43,3 @@ spec:
name: flyte-clusterresourcesync-config
name: config-volume
{{- end }}
{{- end }}
10 changes: 6 additions & 4 deletions charts/flyte-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ flyteadmin:
image:
# -- Docker image for Flyteadmin deployment
repository: cr.flyte.org/flyteorg/flyteadmin # FLYTEADMIN_IMAGE
tag: v0.6.83 # FLYTEADMIN_TAG
tag: v0.6.89 # FLYTEADMIN_TAG
pullPolicy: IfNotPresent
# -- Default resources requests and limits for Flyteadmin deployment
resources:
Expand Down Expand Up @@ -74,7 +74,7 @@ flytescheduler:
# -- Docker image for Flytescheduler deployment
repository: cr.flyte.org/flyteorg/flytescheduler # FLYTESCHEDULER_IMAGE
# -- Docker image tag
tag: v0.6.83 # FLYTESCHEDULER_TAG
tag: v0.6.89 # FLYTESCHEDULER_TAG
# -- Docker image pull policy
pullPolicy: IfNotPresent
# -- Default resources requests and limits for Flytescheduler deployment
Expand Down Expand Up @@ -638,15 +638,17 @@ external_events:
cluster_resource_manager:
# -- Enables the Cluster resource manager component
enabled: true
# -- Starts the cluster resource manager in standalone mode with requisite auth credentials to call flyteadmin service endpoints
standalone_deploy: false
# -- Service account name to run with
service_account_name: flyteadmin
# -- Configmap for ClusterResource parameters
config:
# -- ClusterResource parameters
# Refer to the [structure](https://pkg.go.dev/github.com/lyft/[email protected]/pkg/runtime/interfaces#ClusterResourceConfig) to customize.
cluster_resources:
refreshInterval: 5m
templatePath: "/etc/flyte/clusterresource/templates"
# -- Starts the cluster resource manager in standalone mode with requisite auth credentials to call flyteadmin service endpoints
standaloneDeployment: false
customData:
- production:
- projectQuotaCpu:
Expand Down
Loading

0 comments on commit e980b77

Please sign in to comment.