Skip to content

Commit

Permalink
Simplify Helm storage configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Sören Brunk <[email protected]>
  • Loading branch information
sbrunk committed Apr 14, 2021
1 parent 1556a0d commit 151446d
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 39 deletions.
36 changes: 36 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,39 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
name: {{ . }}
{{- end }}
{{- end }}

{{- define "storage" -}}
storage:
{{- if eq .Values.storage.type "s3" }}
type: s3
container: {{ .Values.storage.bucketName | quote }}
connection:
auth-type: iam
region: {{ .Values.storage.s3.region }}
{{- else if eq .Values.storage.type "gcs" }}
type: stow
stow:
kind: google
config:
json: ""
project_id: {{ .Values.storage.gcs.projectId }}
scopes: https://www.googleapis.com/auth/devstorage.read_write
container: {{ .Values.storage.bucketName | quote }}
{{- else if eq .Values.storage.type "sandbox" }}
type: minio
container: {{ .Values.storage.bucketName | quote }}
connection:
access-key: minio
auth-type: accesskey
secret-key: miniostorage
disable-ssl: true
endpoint: http://minio.flyte.svc.cluster.local:9000
region: us-east-1
{{- else if eq .Values.storage.type "custom" }}
{{- with .Values.storage.custom -}}
{{ toYaml . | nindent 2 }}
{{- end }}
{{- end }}
limits:
maxDownloadMBs: 10
{{- end }}
4 changes: 1 addition & 3 deletions helm/templates/admin/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ data:
{{- with .Values.configmap.server }}
server.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.configmap.storage }}
storage.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
storage.yaml: | {{ include "storage" . | nindent 4 }}
{{- with .Values.configmap.task_resource_defaults }}
task_resource_defaults.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
5 changes: 2 additions & 3 deletions helm/templates/datacatalog/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ data:
{{- with .Values.configmap.datacatalogServer }}
server.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.configmap.storage }}
storage.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
storage.yaml: | {{ include "storage" . | nindent 4 }}
8 changes: 5 additions & 3 deletions helm/templates/propeller/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ data:
spark.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- with .Values.configmap.storage }}
storage.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
storage.yaml: | {{ include "storage" . | nindent 4 }}
cache.yaml: |
cache:
max_size_mbs: {{ .Values.flytepropeller.cacheSizeMbs }}
target_gc_percent: 70
{{- with .Values.configmap.task_logs }}
task_logs.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
9 changes: 0 additions & 9 deletions helm/values-eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,6 @@ configmap:
- project: flytetester
- project: spark-workflows


storage:
storage:
type: s3
container: s3-bucket-for-flyte
connection:
auth-type: iam
region: us-east-1

task_resource_defaults:
task_resources:
defaults:
Expand Down
12 changes: 0 additions & 12 deletions helm/values-sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,6 @@ configmap:
host: postgres
dbname: flyte_development

storage:
storage:
type: minio
container: my-s3-bucket
connection:
access-key: minio
auth-type: accesskey
secret-key: miniostorage
disable-ssl: true
endpoint: http://minio.flyte.svc.cluster.local:9000
region: us-east-1

# Task default resources configuration
task_resource_defaults:
task_resources:
Expand Down
29 changes: 20 additions & 9 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ flytepropeller:
cpu: 10m
ephemeral-storage: 50Mi
memory: 50Mi
cacheSizeMbs: 0
# -- Default regex string for searching configuration files
configPath: /etc/flyte/config/*.yaml
# -- Annotations for ServiceAccount attached to Flytepropeller pods
Expand Down Expand Up @@ -390,6 +391,25 @@ common:
# --- Enable or disable creating Flyte namespace in template. Enable when using helm as template-engine only. Disable when using `helm install ...`.
enabled: false

#
# STORAGE SETTINGS
#

storage:
# -- Sets the storage type. Supported values are sandbox, s3, gcs and custom.
type: sandbox
# -- bucketName defines the storage bucket flyte will use. Required for all types except for sandbox.
# bucketName: my-s3-bucket
# -- settings for storage type s3
s3:
region: us-east-1
# -- settings for storage type gcs
gcs:
# -- GCP project ID. Required for storage type gcs.
# projectId:
# -- Settings for storage type custom. See https://github.com/graymeta/stow for supported storage providers/settings.
custom: {}

#
# CONFIGMAPS SETTINGS
#
Expand Down Expand Up @@ -482,15 +502,6 @@ configmap:
httpPort: 8080
grpcServerReflection: true

# Storage configuration
storage:
storage:
type: minio
container: my-s3-bucket
connection:
auth-type: accesskey
region: us-east-1

# Task default resources configuration
task_resource_defaults:
# -- Task default resources parameters
Expand Down

0 comments on commit 151446d

Please sign in to comment.