From 4566bdf0085d44c377722a204897955e3e33ecfa Mon Sep 17 00:00:00 2001 From: Endial Fang Date: Fri, 21 Mar 2025 10:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0AzureBlobStorage=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Chart.yaml | 2 +- templates/api-deployment.yaml | 2 +- templates/config.tpl | 46 +++++++++++++------------------- templates/credentials.tpl | 5 +++- templates/pvc.yaml | 2 +- templates/worker-deployment.yaml | 2 +- values.yaml | 29 +++++++++++++++----- 7 files changed, 48 insertions(+), 40 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 6b75949..e631678 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -3,7 +3,7 @@ name: dify description: 用于在 Kubernetes 环境部署 Dify 应用的 Helm chart 文件。官网:https://github.com/langgenius/dify type: application # 当前图表的版本,仅用于标识图表文件变更 -version: 0.1.0 +version: 0.1.1 # 部署的主应用的版本;建议使用双引号包起来 appVersion: "1.0.1" diff --git a/templates/api-deployment.yaml b/templates/api-deployment.yaml index 277117d..ca3ec61 100644 --- a/templates/api-deployment.yaml +++ b/templates/api-deployment.yaml @@ -1,5 +1,5 @@ {{- if and .Values.api.enabled}} -{{- $usePvc := not (or .Values.externalS3.enabled .Values.externalOSS.enabled .Values.externalAzureBlobStorage.enabled .Values.externalGCS.enabled .Values.externalCOS.enabled) -}} +{{- $usePvc := not (or .Values.externalS3.enabled .Values.externalAzureBlobStorage.enabled .Values.externalOSS.enabled .Values.externalGCS.enabled .Values.externalCOS.enabled .Values.externalOBS.enabled) -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/config.tpl b/templates/config.tpl index 1958e2c..97dd230 100644 --- a/templates/config.tpl +++ b/templates/config.tpl @@ -126,6 +126,11 @@ CONSOLE_API_URL: {{ .Values.api.url.consoleApi | quote }} APP_API_URL: {{ .Values.api.url.appApi | quote }} # The DSN for Sentry {{- include "dify.marketplace.config" . }} +{{- if and .Values.pluginDaemon.enabled .Values.pluginDaemon.marketplace.enabled .Values.pluginDaemon.marketplace.apiProxyEnabled }} +MARKETPLACE_API_URL: "/marketplace" +{{- else }} +MARKETPLACE_API_URL: {{ .Values.api.url.marketplaceApi | quote }} +{{- end }} MARKETPLACE_URL: {{ .Values.api.url.marketplace | quote }} {{- end }} @@ -275,24 +280,10 @@ QDRANT_GRPC_PORT: {{ .Values.externalQdrant.grpc.port | quote }} {{- else if .Values.externalMilvus.enabled}} # Milvus configuration Only available when VECTOR_STORE is `milvus`. VECTOR_STORE: milvus -# The milvus host. -MILVUS_HOST: {{ .Values.externalMilvus.host | quote }} -# The milvus host. -MILVUS_PORT: {{ .Values.externalMilvus.port | toString | quote }} -# The milvus URI. -{{- if .Values.externalMilvus.uri }} +# Milvus endpoint MILVUS_URI: {{ .Values.externalMilvus.uri | quote }} -{{- else }} -MILVUS_URI: {{ .Values.externalMilvus.host }}:{{ .Values.externalMilvus.port }} -{{- end }} # The milvus database MILVUS_DATABASE: {{ .Values.externalMilvus.database | quote }} -# The milvus username. -# MILVUS_USER: {{ .Values.externalMilvus.user | quote }} -# The milvus password. -# MILVUS_PASSWORD: {{ .Values.externalMilvus.password | quote }} -# The milvus tls switch. -MILVUS_SECURE: {{ .Values.externalMilvus.useTLS | toString | quote }} {{- else if .Values.externalPgvector.enabled}} # pgvector configurations, only available when VECTOR_STORE is `pgvecto-rs or pgvector` VECTOR_STORE: pgvector @@ -360,18 +351,6 @@ SMTP_OPPORTUNISTIC_TLS: {{ .Values.api.mail.smtp.tls.optimistic | toString | quo {{- end }} {{- end }} -{{/* -Python 3.12.x 国内镜像源,配置文件挂载路径:/root/.config/pip/pip.conf -*/}} -{{- define "dify.python.environment.config" -}} -[global] -index-url = http://mirrors.aliyun.com/pypi/simple/ - -[install] -trusted-host = mirrors.aliyun.com - -{{- end }} - {{- define "dify.sandbox.config" -}} GIN_MODE: release SANDBOX_PORT: '8194' @@ -466,6 +445,17 @@ server { include proxy.conf; } + {{- if and .Values.pluginDaemon.enabled .Values.pluginDaemon.marketplace.enabled .Values.pluginDaemon.marketplace.apiProxyEnabled }} + location /marketplace { + rewrite ^/marketplace/(.*)$ /$1 break; + proxy_ssl_server_name on; + proxy_pass {{ .Values.api.url.marketplace | quote }}; + proxy_pass_request_headers off; + proxy_set_header Host {{ regexReplaceAll "^https?://([^/]+).*" .Values.api.url.marketplace "${1}" | quote }}; + proxy_set_header Connection ""; + } + {{- end }} + location / { proxy_pass http://{{ template "dify.web.fullname" .}}:{{ .Values.web.service.port }}; include proxy.conf; @@ -551,7 +541,7 @@ SERVER_PORT: "5002" PLUGIN_REMOTE_INSTALLING_HOST: "0.0.0.0" PLUGIN_REMOTE_INSTALLING_PORT: "5003" MAX_PLUGIN_PACKAGE_SIZE: "52428800" -PLUGIN_WORKING_PATH: {{ .Values.pluginDaemon.persistence.mountPath | quote }} +PLUGIN_WORKING_PATH: {{ printf "%s/cwd" .Values.pluginDaemon.persistence.mountPath | clean | quote }} DIFY_INNER_API_URL: "http://{{ template "dify.api.fullname" . }}:{{ .Values.api.service.port }}" {{- include "dify.marketplace.config" . }} {{- end }} diff --git a/templates/credentials.tpl b/templates/credentials.tpl index 59b767d..08f9cf4 100644 --- a/templates/credentials.tpl +++ b/templates/credentials.tpl @@ -109,8 +109,11 @@ WEAVIATE_API_KEY: {{ .Values.externalWeaviate.apiKey | b64enc | quote }} {{- else if .Values.externalQdrant.enabled }} QDRANT_API_KEY: {{ .Values.externalQdrant.apiKey | b64enc | quote }} {{- else if .Values.externalMilvus.enabled}} +# the milvus token +MILVUS_TOKEN: {{ .Values.externalMilvus.token | b64enc | quote }} +# the milvus username MILVUS_USER: {{ .Values.externalMilvus.user | b64enc | quote }} -# The milvus password. +# the milvus password MILVUS_PASSWORD: {{ .Values.externalMilvus.password | b64enc | quote }} {{- else if .Values.externalPgvector.enabled}} PGVECTOR_USER: {{ .Values.externalPgvector.username | b64enc | quote }} diff --git a/templates/pvc.yaml b/templates/pvc.yaml index 528612d..8b673d7 100644 --- a/templates/pvc.yaml +++ b/templates/pvc.yaml @@ -1,4 +1,4 @@ -{{- if not (or .Values.externalS3.enabled .Values.externalAzureBlobStorage.enabled .Values.externalOSS.enabled) }} +{{- if not (or .Values.externalS3.enabled .Values.externalAzureBlobStorage.enabled .Values.externalOSS.enabled .Values.externalGCS.enabled .Values.externalCOS.enabled .Values.externalOBS.enabled) }} {{- $pvc := .Values.api.persistence.persistentVolumeClaim -}} {{- if (not $pvc.existingClaim) }} apiVersion: v1 diff --git a/templates/worker-deployment.yaml b/templates/worker-deployment.yaml index 1114782..9d7ad64 100644 --- a/templates/worker-deployment.yaml +++ b/templates/worker-deployment.yaml @@ -1,5 +1,5 @@ {{- if and .Values.worker.enabled}} -{{- $usePvc := not (or .Values.externalS3.enabled .Values.externalOSS.enabled .Values.externalAzureBlobStorage.enabled .Values.externalGCS.enabled .Values.externalCOS.enabled) -}} +{{- $usePvc := not (or .Values.externalS3.enabled .Values.externalAzureBlobStorage.enabled .Values.externalOSS.enabled .Values.externalGCS.enabled .Values.externalCOS.enabled .Values.externalOBS.enabled) -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/values.yaml b/values.yaml index 59f0934..1dbe079 100644 --- a/values.yaml +++ b/values.yaml @@ -186,7 +186,7 @@ api: marketplace: "https://marketplace.dify.ai" mail: # default email sender from email address, if not given a specific address - defaultSender: "YOUR EMAIL FROM (e.g., no-reply )" + defaultSender: "YOUR EMAIL FROM (e.g.: no-reply )" # Mail type, supported values are `smtp`, `resend` https://docs.dify.ai/getting-started/install-self-hosted/environments#mail-related-configuration type: "resend" resend: @@ -628,7 +628,7 @@ pluginDaemon: # A separate key for interactions between `api`(`worker`) and `pluginDaemon` difyApiKey: "QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1" persistence: - mountPath: "/app/storage/cwd" + mountPath: "/app/storage" annotations: helm.sh/resource-policy: keep persistentVolumeClaim: @@ -646,6 +646,10 @@ pluginDaemon: subPath: "" marketplace: enabled: true + # Takes effect only if built-in `nginx` were enabled + # If enabled, route marketplace api call to built-in `nginx` and strip headers for tracking. + # https://github.com/BorisPolonsky/dify-helm/pull/131 + apiProxyEnabled: false ## pluginDaemon ServiceAccount configuration ## serviceAccount: @@ -3044,6 +3048,17 @@ externalCOS: bucketName: "your-bucket-name" scheme: "your-scheme" +################################### +# External HUAWEI OBS +# - these configs are only used when `externalS3.enabled` and `externalAzureBlobStorage.enabled` and `externalOSS.enabled` and `externalGCS.enabled` and `externalCOS.enabled` are false and `externalOBS.enabled` is true +################################### +externalOBS: + enabled: false + secretKey: "your-secret-key" + secretId: "your-secret-id" + bucketName: "your-bucket-name" + server: "your-server" + ################################### # External Redis # - these configs are only used when `externalRedis.enabled` is true @@ -3084,11 +3099,11 @@ externalQdrant: ################################### externalMilvus: enabled: false - uri: "your-milvus.domain:19530" - database: "default" - user: "user" - password: "Milvus" - useTLS: false + uri: "http://your-milvus.domain:19530" + database: 'default' + token: "" + user: "" + password: "" ################################### # External Pgvector