Skip to content

Commit

Permalink
Merge pull request #3108 from FlowFuse/feat-chart-upgrade
Browse files Browse the repository at this point in the history
Describe local pgsql upgrade process
  • Loading branch information
hardillb committed Jan 17, 2024
2 parents 7ad420b + 3a204d8 commit d785306
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
49 changes: 49 additions & 0 deletions docs/install/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,55 @@ forge:

## Upgrade

### Upgrading to 2.0

Together with new application features, this release updates the Helm sub-chart, Bitnami's Postgresql, version.
If local PostgreSQL database instance is used, upgrading to this version, using our Helm chart, requires additional steps.

1. Backup the database ([yq](https://mikefarah.gitbook.io/yq/#install) and [ghead](https://formulae.brew.sh/formula/coreutils) (part of `coreutils` package, MacOS only) tools are required)

For linux:

```bash
DBPASSWORD=$(kubectl get cm flowforge-config -o jsonpath='{.data.flowforge\.yml}' | yq ".db.password")
kubectl run -it --rm db-backup --env="PGPASSWORD=$DBPASSWORD" --image ubuntu/postgres:14-22.04_edge -- bash -c "pg_dump -h flowforge-postgresql -U forge flowforge" | head -n -2 > db.sql
```

For macOS/BSD:

```bash
DBPASSWORD=$(kubectl get cm flowforge-config -o jsonpath='{.data.flowforge\.yml}' | yq ".db.password")
kubectl run -it --rm db-backup --env="PGPASSWORD=$DBPASSWORD" --image ubuntu/postgres:14-22.04_edge -- bash -c "pg_dump -h flowforge-postgresql -U forge flowforge" | ghead -n -2 > db.sql
```

2. Obtain the PVC name which stores the database data

```bash
export POSTGRESQL_PVC=$(kubectl --namespace default get pvc -l app.kubernetes.io/name=postgresql,role=primary -o jsonpath="{.items[0].metadata.name}")
```

3. Delete postgresql statefulset and secret

```bash
kubectl --namespace default delete statefulset.app flowforge-postgresql
kubectl --namespace default delete secret flowforge-postgresql
```

4. Get database image version and perform the upgrade

```bash
CURRENT_VERSION=$(kubectl --namespace defualt exec postgresql-postgresql-0 -- bash -c 'echo $BITNAMI_IMAGE_VERSION')

helm upgrade --install --atomic \
--namespace default \
--values $path/to/your/values.yaml \
--set postgresql.primary.persistance.existingClaim=$POSTGRESQL_PVC \
--set postgresql.image.tag=$CURRENT_VERSION \
flowforge flowforge/flowforge
```

### Upgrading to 1.12

As of FlowFuse v1.12.0 the URL used to host the helm chart changed, so in order to upgrade from a previous
version you will need to update the repo.

Expand Down
9 changes: 8 additions & 1 deletion docs/upgrade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ Details of how to upgrade can be found for each deployment model:
- [Docker](../install/docker/README.md#upgrade)
- [Kubernetes](../install/kubernetes/README.md#upgrade)

## Specific requirements for a given target version

### Upgrading to 2.0.0

> **⚠️** Breaking changes introduced!
Together with new application features, this **release 2.0.0 introduces breaking changes** in Flowfuse Helm chart.
If you are managing your local Flowfuse instance using our [Helm Chart](https://github.com/FlowFuse/helm/tree/main/helm/flowforge), please refer to the [upgrade](../install/kubernetes/README.md#upgrading-to-2.0) section of the Kubernetes installation guide for more details.


### Upgrading to 1.10

Expand Down

0 comments on commit d785306

Please sign in to comment.