From bc5cf41bb3ea83ce92edeef280323f9a03c6bdd7 Mon Sep 17 00:00:00 2001 From: Piotr Pawlowski Date: Wed, 22 Nov 2023 22:24:36 +0100 Subject: [PATCH 1/5] Describe local pgsql upgrade process --- docs/upgrade/README.md | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/upgrade/README.md b/docs/upgrade/README.md index b052f0f6a6..4c1520804b 100644 --- a/docs/upgrade/README.md +++ b/docs/upgrade/README.md @@ -15,6 +15,51 @@ for each version you are upgrading across. Note that we do not support downgrading FlowFuse to previous levels once an upgrade has been performed. +### Upgrading to 1.14 + +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 + + For linux: + + ```bash + kubectl run -it --rm db-backup --env=“PGPASSWORD=$putPasswordHere” --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 + kubectl run -it --rm db-backup --env=“PGPASSWORD=$putPasswordHere --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.10 Endpoint Rate Limiting is now available to FlowFuse. This is disabled by default, but can be enabled by setting the `rate_limits.enabled` config setting to `true`. From ba28e163433ee704d3cfe3466e890ef6987e5789 Mon Sep 17 00:00:00 2001 From: Piotr Pawlowski Date: Mon, 11 Dec 2023 09:52:54 +0100 Subject: [PATCH 2/5] Bump version --- docs/upgrade/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/upgrade/README.md b/docs/upgrade/README.md index ae3e332b3a..e891762134 100644 --- a/docs/upgrade/README.md +++ b/docs/upgrade/README.md @@ -23,7 +23,7 @@ Details of how to upgrade can be found for each deployment model: - [Docker](../install/docker/README.md#upgrade) - [Kubernetes](../install/kubernetes/README.md#upgrade) -### Upgrading to 1.14 +### Upgrading to 1.15 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. From ba0f7375bfc24d2fb4ef1bd653ab55ef413578e5 Mon Sep 17 00:00:00 2001 From: Piotr Pawlowski Date: Mon, 11 Dec 2023 13:41:03 +0100 Subject: [PATCH 3/5] Add step for getting database password --- docs/upgrade/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/upgrade/README.md b/docs/upgrade/README.md index e891762134..9df88473a9 100644 --- a/docs/upgrade/README.md +++ b/docs/upgrade/README.md @@ -28,18 +28,20 @@ Details of how to upgrade can be found for each deployment model: 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 +1. Backup the database (`yq` and `ghead` (MacOS only) tools are required) For linux: ```bash - kubectl run -it --rm db-backup --env=“PGPASSWORD=$putPasswordHere” --image ubuntu/postgres:14-22.04_edge -- bash -c “pg_dump -h flowforge-postgresql -U forge flowforge” | head -n -2 > db.sql + 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 - kubectl run -it --rm db-backup --env=“PGPASSWORD=$putPasswordHere --image ubuntu/postgres:14-22.04_edge -- bash -c “pg_dump -h flowforge-postgresql -U forge flowforge” | ghead -n -2 > db.sql + 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 From de91c28480b6df37af7a75b71709a2a6ec00d3d3 Mon Sep 17 00:00:00 2001 From: Piotr Pawlowski Date: Wed, 17 Jan 2024 14:20:24 +0100 Subject: [PATCH 4/5] Rearrange helm chart 2.0 upgrade instructions --- docs/install/kubernetes/README.md | 49 +++++++++++++++++++++++++++++++ docs/upgrade/README.md | 46 +++-------------------------- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/docs/install/kubernetes/README.md b/docs/install/kubernetes/README.md index 788dd689c7..de49f78321 100644 --- a/docs/install/kubernetes/README.md +++ b/docs/install/kubernetes/README.md @@ -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` and `ghead` (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. diff --git a/docs/upgrade/README.md b/docs/upgrade/README.md index 9df88473a9..8917ca0acd 100644 --- a/docs/upgrade/README.md +++ b/docs/upgrade/README.md @@ -23,52 +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) -### Upgrading to 1.15 -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. +### Upgrading to 2.0.0 -1. Backup the database (`yq` and `ghead` (MacOS only) tools are required) +> **⚠️** Breaking changes introduced! - 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 - ``` +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. - 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.10 From 3a204d87cbd246332247a8882824ec68f2f4fc99 Mon Sep 17 00:00:00 2001 From: Piotr Pawlowski Date: Wed, 17 Jan 2024 15:47:55 +0100 Subject: [PATCH 5/5] Link required tools to installation guides --- docs/install/kubernetes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/kubernetes/README.md b/docs/install/kubernetes/README.md index de49f78321..207d50f59b 100644 --- a/docs/install/kubernetes/README.md +++ b/docs/install/kubernetes/README.md @@ -214,7 +214,7 @@ forge: 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` and `ghead` (MacOS only) tools are required) +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: