Skip to content

Commit

Permalink
refactor: ♻️ format, add types
Browse files Browse the repository at this point in the history
  • Loading branch information
deoomen committed Jun 14, 2024
1 parent 39ecbdb commit d6b2dff
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions charts/dify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,47 +34,55 @@ minio:
embedded: true
```
```
```sh
# install it
helm repo add douban https://douban.github.io/charts/
helm upgrade dify douban/dify -f values.yaml --install --debug
```

**Must** run db migration after installation, or the instance would not work.
```

```sh
# run migration
kubectl exec -it dify-pod-name -- flask db upgrade
```

## Upgrade

To upgrade app, change the value of `global.image.tag` to the desired version
```

```yaml
global:
image:
tag: "0.6.3"
```
Then upgrade the app with helm command
```
```sh
helm upgrade dify douban/dify -f values.yaml --debug
```

**Must** run db migration after upgrade.
```

```sh
# 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!!

You **must do** the following extra work before put it into production!!


### Protect Sensitive info with secret

Environment variable like `SECRET_KEY` could be harmful if leaked, it is adviced to protect them using secret or csi volume.

The example of using secret is like
```

```yaml
global:
extraBackendEnvs:
- name: SECRET_KEY
Expand All @@ -84,14 +92,14 @@ global:
key: SECRET_KEY
```
Read more: https://kubernetes.io/docs/concepts/security/secrets-good-practices/
Read more: <https://kubernetes.io/docs/concepts/security/secrets-good-practices/>
### External postgresql
1. set the `postgresql.embedded` to `false`
2. inject connection info with `global.extraBackendEnvs`

```
```yaml
global:
extraBackendEnvs:
- name: DB_USERNAME
Expand All @@ -111,9 +119,11 @@ global:
```

### External redis

1. set the `redis.embedded` to `false`
2. inject connection info with `global.extraBackendEnvs`
```

```yaml
global:
extraBackendEnvs:
- name: REDIS_HOST
Expand Down Expand Up @@ -142,7 +152,7 @@ global:
1. set the `minio.embedded` to `false`
2. inject connection info with `global.extraBackendEnvs`

```
```yaml
global:
extraBackendEnvs:
- name: STORAGE_TYPE
Expand Down Expand Up @@ -187,7 +197,7 @@ global:

due to the complexity of vector db, this component is not included, you have to use external vector db, likewise , you can inject environment variable to use it

```
```yaml
global:
extraBackendEnvs:
- name: VECTOR_STORE
Expand Down

0 comments on commit d6b2dff

Please sign in to comment.