From e33e9f0ecb2c89ed3d2217198c3f29f714448532 Mon Sep 17 00:00:00 2001 From: Leo Q Date: Fri, 12 Apr 2024 13:15:07 +0800 Subject: [PATCH] Update Dify chart and app versions (#73) --- charts/dify/Chart.yaml | 6 +++--- charts/dify/README.md | 24 +++++++++++++++++++++++- charts/dify/templates/deployment.yaml | 6 +++--- charts/dify/values.yaml | 3 ++- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/charts/dify/Chart.yaml b/charts/dify/Chart.yaml index 31bbadf..3d29f40 100644 --- a/charts/dify/Chart.yaml +++ b/charts/dify/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: dify -description: A Helm chart for Kubernetes +description: A Helm chart for Dify home: https://github.com/langgenius/dify @@ -20,13 +20,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.2 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.6.1" +appVersion: "0.6.2" dependencies: - name: redis diff --git a/charts/dify/README.md b/charts/dify/README.md index 609357e..1268076 100644 --- a/charts/dify/README.md +++ b/charts/dify/README.md @@ -13,6 +13,11 @@ global: host: "mydify.example.com" enableTLS: false + image: + # Set to the latest version of dify + # Check the version here: https://github.com/langgenius/dify/releases + # If not set, Using the default value in Chart.yaml + tag: "0.6.2" extraBackendEnvs: - name: SECRET_KEY value: "generate your own one" @@ -40,7 +45,24 @@ helm upgrade dify douban/dify -f values.yaml --install --debug kubectl exec -it dify-pod-name -- flask db upgrade ``` -**Always** run this command after dify upgrade. +## Upgrade +To upgrade app, change the value of `global.image.tag` to the desired version +``` +global: + image: + tag: "0.6.2" +``` + +Then upgrade the app with helm command +``` +helm upgrade dify douban/dify -f values.yaml --debug +``` + +**Must** run db migration after upgrade. +``` +# run migration +kubectl exec -it dify-pod-name -- flask db upgrade +``` ## Production use checklist The minimal configure provided above is sufficient for experiment but **without any persistance**, all your data would be lost if you restarted the postgresql pod or minio pod!! diff --git a/charts/dify/templates/deployment.yaml b/charts/dify/templates/deployment.yaml index 2cb45e1..13d9168 100644 --- a/charts/dify/templates/deployment.yaml +++ b/charts/dify/templates/deployment.yaml @@ -36,7 +36,7 @@ spec: - name: {{ .Chart.Name }}-api securityContext: {{- toYaml .Values.api.securityContext | nindent 12 }} - image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.api.image.repository }}:{{ coalesce .Values.api.image.tag .Values.global.image.tag .Chart.AppVersion }}" imagePullPolicy: {{ .Values.api.image.pullPolicy }} env: - name: MODE @@ -137,7 +137,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.worker.securityContext | nindent 12 }} - image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.worker.image.repository }}:{{ coalesce .Values.worker.image.tag .Values.global.image.tag .Chart.AppVersion }}" imagePullPolicy: {{ .Values.worker.image.pullPolicy }} args: - worker @@ -213,7 +213,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.frontend.securityContext | nindent 12 }} - image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.frontend.image.repository }}:{{ coalesce .Values.frontend.image.tag .Values.global.image.tag .Chart.AppVersion }}" imagePullPolicy: {{ .Values.frontend.image.pullPolicy }} env: {{- include "dify.commonEnvs" . | nindent 12 }} diff --git a/charts/dify/values.yaml b/charts/dify/values.yaml index 5eeb145..0bef6c4 100644 --- a/charts/dify/values.yaml +++ b/charts/dify/values.yaml @@ -14,6 +14,8 @@ fullnameOverride: "" global: host: "chart-example.local" enableTLS: false + image: + tag: "" edition: "SELF_HOSTED" # the following extra configs would be injected into: # * frontend @@ -35,7 +37,6 @@ global: # secretKeyRef: # name: dify # key: SECRET_KEY - ingress: enabled: false