Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dify chart and app versions #73

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/dify/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
24 changes: 23 additions & 1 deletion charts/dify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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!!
Expand Down
6 changes: 3 additions & 3 deletions charts/dify/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/dify/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,7 +37,6 @@ global:
# secretKeyRef:
# name: dify
# key: SECRET_KEY


ingress:
enabled: false
Expand Down
Loading