Migrating from Bitnami to Postgres 2.0.0+ Helm chart
Migrating away from Bitnami Broadcom helm charts
As Bitnami no longer provides stable versions of Postgres images with their helm charts, we have decided to provide our own standalone Postgres images as part of our latest Postgres 2.0.0 helm chart release.
Prerequisites
- postgresql client 17.x
- postgres 17.2
- helm 3.17+
- kubectl 1.28+
- Kubernetes API access
- fossa helm charts
- https://docs.fossa.com/update/docs/1-2#/
- postgres helm chart version
2.0.0fromfossa/postgres
- quay pull secrets
Assumptions
- Your Helm release is named
fossa. - Database credentials are:
fossa/fossa123for Core- Service:
- Bitnami database:
fossa-core-db-postgresql - New database:
postgres-core
- Bitnami database:
- Service:
fossa/fossa123for Sparkle- Service:
- Bitnami database:
fossa-sparkle-db-postgresql - New database:
postgres-sparkle
- Bitnami database:
- Service:
fossa/fossa123for Hubble- Service address:
- Bitnami database:
fossa-hubble-db-postgresql - New database:
postgres-hubble
- Bitnami database:
- Service address:
- Resource settings align with Core’s defaults unless otherwise specified.
- Vulns updater is enabled (unless noted otherwise).
- Quay.io pull secrets:
- username:
fossa+customer - password:
HELLOWORLD1
- username:
Migration Steps
Install and Update Fossa Helm Charts repository
helm repo add fossa https://charts.fossa.com
helm repo updateSet namespace
- Set the namespace to
fossa
kubectl config set-context namespace=fossaCreate values files for each database
- Create a new values file for core, sparkle and hubble databases with the appropriate auth credentials and database resources for the Postgres chart.
Core core-psql-values.yml
core-psql-values.ymldatabase: fossa
username: fossa
password: fossa123
image.registry: quay.io
image.repository: fossa/postgres
image.tag: 17.2-1
imageCredentials:
username: fossa+customer
password: HELLOWORLD1
resources:
limits:
cpu: 4000m
memory: 4Gi
requests:
cpu: 2000m
memory: 4GiSparkle sparkle-psql-values.yml
sparkle-psql-values.ymldatabase: sparkle
username: fossa
password: fossa123
image.registry: quay.io
image.repository: fossa/postgres
image.tag: 17.2-1
imageCredentials:
username: fossa+customer
password: HELLOWORLD1
resources:
limits:
cpu: 4000m
memory: 4Gi
requests:
cpu: 2000m
memory: 4GiHubble hubble-psql-values.yml
hubble-psql-values.ymldatabase: hubble
username: fossa
password: fossa123
image.registry: quay.io
image.repository: fossa/postgres
image.tag: 17.2-1
imageCredentials:
username: fossa+customer
password: HELLOWORLD1
resources:
limits:
cpu: 4000m
memory: 4Gi
requests:
cpu: 2000m
memory: 4GiInstall the Postgres helm chart from fossa/postgres for each database
fossa/postgres for each database- Install the Postgres chart using the new values file for core, sparkle and hubble databases.
helm upgrade -i postgres-core fossa/postgres --values core-psql-values.yml
helm upgrade -i postgres-sparkle fossa/postgres --values sparkle-psql-values.yml
helm upgrade -i postgres-hubble fossa/postgres --values hubble-psql-values.ymlSet the application to maintenance mode
- Set the application to maintenance mode.
helm upgrade -i fossa fossa/fossa-core --set global.maintenanceMode.enabled=true --set vulns.updater.enabled=false --reuse-valuesIf your vulns updater is disabled, please ignore the vulns updater parameters and set the maintenance mode to true as follows:
helm upgrade -i fossa fossa/fossa-core --set global.maintenanceMode.enabled=true --reuse-valuesCreate database backups
- Make a backup of core, hubble and sparkle fossa databases deployed with Bitnami helm chart and terminate port-forward upon completion.
Core
### Core
kubectl port-forward service/fossa-core-db-postgresql 5432:5432 &
pg_dumpall -h localhost -U fossa -f fossa-core-backup.bkp
# Terminate port-forward using `fg` and `Ctrl+C`
fgSparkle
kubectl port-forward service/fossa-sparkle-db-postgresql 5432:5432 &
pg_dumpall -h localhost -U fossa -f fossa-sparkle-backup.bkp
# Terminate port-forward using `fg` and `Ctrl+C`
fgHubble
kubectl port-forward service/fossa-hubble-db-postgresql 5432:5432 &
pg_dumpall -h localhost -U fossa -f fossa-hubble-backup.bkp
# Terminate port-forward using `fg` and `Ctrl+C`
fgRestore database backups
- Restore the fossa database from the backup for core, hubble and sparkle databases.
Core
### Core
kubectl port-forward service/postgres-core 5432:5432 &
psql -h localhost -U fossa -d fossa -f fossa-core-backup.bkp
# Terminate the port-forward using `fg` and `Ctrl+C`
fgSparkle
kubectl port-forward service/postgres-sparkle 5432:5432 &
psql -h localhost -U fossa -d sparkle -f fossa-sparkle-backup.bkp
# Terminate the port-forward using `fg` and `Ctrl+C`
fgHubble
kubectl port-forward service/postgres-hubble 5432:5432 &
psql -h localhost -U fossa -d hubble -f fossa-hubble-backup.bkp
# Terminate the port-forward using `fg` and `Ctrl+C`
fgCheck the health of the databases
- Ensure the core, sparkle and hubble databases are running and healthy.
kubectl logs sts/postgres-core -f
kubectl logs sts/postgres-sparkle -f
kubectl logs sts/postgres-hubble -f
Update the applications
- Update the release to use the new Postgres 17.2 databases from fossa/postgres.
Core
helm upgrade -i fossa fossa/fossa-core --set postgres.host=postgres-core --reuse-valuesSparkle
helm upgrade -i fossa fossa/fossa-sparkle --set sparklePostgres.host=postgres-sparkle --reuse-valuesHubble
helm upgrade -i fossa fossa/fossa-hubble --set hubble.postgres.host=postgres-hubble --reuse-valuesSet the application to production mode
- Set the application to production mode
helm upgrade -i fossa fossa/fossa-core --set global.maintenanceMode.enabled=false --set vulns.updater.enabled=true --reuse-valuesIf your vulns updater is disabled, please ignore the vulns updater parameters and set the maintenance mode to false as follows:
helm upgrade -i fossa fossa/fossa-core --set global.maintenanceMode.enabled=false --reuse-valuesEnsure the application is healthy
- Ensure the application is running and healthy.
kubectl logs deployment/fossa-fossa-core-api -f
kubectl logs deployment/fossa-fossa-core-workers-primary -f
kubectl logs deployment/fossa-fossa-hubble-api -f
kubectl logs deployment/fossa-fossa-core-sparkle-api -fUpdate your main values file
- Finally after confirming the applications are running and healthy, update your values file to use the new databases.
Core
postgres:
host: postgres-coreSparkle
sparklePostgres:
host: postgres-sparkleHubble
hubble:
postgres:
host: postgres-hubbleFinal Verification
Once all updates are complete:
- Ensure all FOSSA pods are healthy.
- Verify schema migrations completed successfully.
- Confirm that FOSSA Core, Sparkle, and Hubble services are operating normally.
- Confirm that the same data is still available by accessing your web interface
Delete Bitnami Databases
After confirming it is using the database and that the data is no longer needed from the Bitnami databases, we can proceed to delete the unused databases.
helm delete fossa-core-db
helm delete fossa-sparkle-db
helm delete fossa-hubble-db
Updated about 1 month ago
What’s Next
