Skip to content

Commit

Permalink
feat: add external google cloud storage config (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
longnbao authored Dec 23, 2024
1 parent 0e59632 commit 4544ebd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/dify/templates/api-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and .Values.api.enabled}}
{{- $usePvc := not (or .Values.externalS3.enabled .Values.externalOSS.enabled .Values.externalAzureBlobStorage.enabled) -}}
{{- $usePvc := not (or .Values.externalS3.enabled .Values.externalOSS.enabled .Values.externalAzureBlobStorage.enabled .Values.externalGCS.enabled) -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
11 changes: 8 additions & 3 deletions charts/dify/templates/config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ DB_DATABASE: {{ .Values.postgresql.global.postgresql.auth.database }}

{{- define "dify.storage.config" -}}
{{- if .Values.externalS3.enabled }}
# The type of storage to use for storing user files. Supported values are `local`, `s3`, `azure-blob` and `aliyun-oss`, Default: `local`
# The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
STORAGE_TYPE: s3
# The S3 storage configurations, only available when STORAGE_TYPE is `s3`.
S3_ENDPOINT: {{ .Values.externalS3.endpoint }}
Expand All @@ -156,15 +156,15 @@ S3_BUCKET_NAME: {{ .Values.externalS3.bucketName }}
# S3_SECRET_KEY: {{ .Values.externalS3.secretKey }}
S3_REGION: {{ .Values.externalS3.region }}
{{- else if .Values.externalAzureBlobStorage.enabled }}
# The type of storage to use for storing user files. Supported values are `local`, `s3`, `azure-blob` and `aliyun-oss`, Default: `local`
# The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
STORAGE_TYPE: azure-blob
# The Azure Blob storage configurations, only available when STORAGE_TYPE is `azure-blob`.
AZURE_BLOB_ACCOUNT_NAME: {{ .Values.externalAzureBlobStorage.account | quote }}
# AZURE_BLOB_ACCOUNT_KEY: {{ .Values.externalAzureBlobStorage.key | quote }}
AZURE_BLOB_CONTAINER_NAME: {{ .Values.externalAzureBlobStorage.container | quote }}
AZURE_BLOB_ACCOUNT_URL: {{ .Values.externalAzureBlobStorage.url | quote }}
{{- else if .Values.externalOSS.enabled }}
# The type of storage to use for storing user files. Supported values are `local`, `s3`, `azure-blob` and `aliyun-oss`, Default: `local`
# The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
STORAGE_TYPE: aliyun-oss
# The OSS storage configurations, only available when STORAGE_TYPE is `aliyun-oss`.
ALIYUN_OSS_ENDPOINT: {{ .Values.externalOSS.endpoint }}
Expand All @@ -173,6 +173,11 @@ ALIYUN_OSS_BUCKET_NAME: {{ .Values.externalOSS.bucketName }}
# ALIYUN_OSS_SECRET_KEY: {{ .Values.externalOSS.secretKey }}
ALIYUN_OSS_REGION: {{ .Values.externalOSS.region }}
ALIYUN_OSS_AUTH_VERSION: {{ .Values.externalOSS.authVersion }}
{{- else if .Values.externalGCS.enabled }}
# The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
STORAGE_TYPE: google-storage
GOOGLE_STORAGE_BUCKET_NAME: {{ .Values.externalGCS.bucketName }}
GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64: {{ .Values.externalGCS.serviceAccountJsonBase64 }}
{{- else }}
# The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob`, Default: `local`
STORAGE_TYPE: local
Expand Down
2 changes: 1 addition & 1 deletion charts/dify/templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and .Values.worker.enabled}}
{{- $usePvc := not (or .Values.externalS3.enabled .Values.externalOSS.enabled .Values.externalAzureBlobStorage.enabled) -}}
{{- $usePvc := not (or .Values.externalS3.enabled .Values.externalOSS.enabled .Values.externalAzureBlobStorage.enabled .Values.externalGCS.enabled) -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
9 changes: 9 additions & 0 deletions charts/dify/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2791,6 +2791,15 @@ externalOSS:
bucketName: "difyai"
authVersion: v4

###################################
# External Google Cloud Storage
# - these configs are only used when `externalS3.enabled` and `externalAzureBlobStorage.enabled` and `externalOSS.enabled` are false and `externalGCS.enabled` is true
###################################
externalGCS:
enabled: false
bucketName: "difyai"
serviceAccountJsonBase64: ""

###################################
# External Redis
# - these configs are only used when `externalRedis.enabled` is true
Expand Down

0 comments on commit 4544ebd

Please sign in to comment.