Postgres 17 Upgrade

This guide will walk you through the process of migrating a Postgres database from version 11.8 under the fossa chart to version 17.2.0 of Bitnami Postgres using Helm.

Upgrade to Postgres 17.2 for each database (Core, Sparkle, Hubble)

Upgrade to Postgres 17.2 for each database (Core, Sparkle, Hubble)

FOSSA Postgres Helm Chart Deprecation

After June 16 2025, FOSSA will no longer include a postgres chart within our helm charts, any customers who rely on using a provisioned postgres instance (postgres.provisionInstance, hubble.postgres.provisionInstance, or sparklePostgres.provisionInstance ) will need to migrate to Bitnami for future versions to work.

Prerequisites

  • postgresql client 17.x
  • helm 3.17+
  • kubectl 1.28+
    • Kubernetes API access

Recommendations

  • The values used for the databases are the same as the default values for the core database. If the resources requirements are different from core's default values, please adjust the Bitnami database values file accordingly (bitnami-core-psql-values.yml, bitnami-sparkle-psql-values.yml, bitnami-hubble-psql-values.yml) or create a new values file for the respective database.
  • Fossa core values are the default settings for the helm chart, as part of the migration we will be using the same values that was used in the current release assuming the correct release is defined.
  • After ensuring the applications are running and healthy, please update your values file to use the new databases.
  • If your vulns updater is disabled, please ignore the vulns updater parameters.

Assumptions

  • The helm release is named fossa
  • Database credentials are fossa for username and password fossa123
  • The database is named fossa for core, sparkle for sparkle and hubble for hubble
  • Resources defined for each database are the same as core's default resources values
  • Vulns updater is enabled. If your vulns updater is disabled, please ignore the vulns updater parameters.

Steps


Set namespace

  1. Set the namespace to fossa
kubectl config set-context namespace=fossa


Create values files for each database for the Bitnami chart

  1. Create a new values file for core, sparkle and hubble databases with the appropriate auth credentials and database resources for the Bitnami Postgres chart.

Core bitnami-core-psql-values.yml

auth:
  username: fossa
  password: fossa123
  database: fossa

primary:
  persistence:
    size: 8Gi
  resources:
    limits:
      cpu: 4000m
      memory: 4Gi
    requests:
      cpu: 2000m
      memory: 4Gi

Sparkle bitnami-sparkle-psql-values.yml

auth:
  username: fossa
  password: fossa123
  database: sparkle

primary:
  persistence:
    size: 8Gi
  resources:
    limits:
      cpu: 4000m
      memory: 4Gi
    requests:
      cpu: 2000m
      memory: 4Gi

Hubble bitnami-hubble-psql-values.yml

auth:
  username: fossa
  password: fossa123
  database: hubble

primary:
  persistence:
    size: 8Gi
  resources:
    limits:
      cpu: 4000m
      memory: 4Gi
    requests:
      cpu: 2000m
      memory: 4Gi

Install the Bitnami helm chart for each database

  1. Install the Bitnami Postgres chart using the new values file for core, sparkle and hubble databases.
helm upgrade -i fossa-core-db oci://registry-1.docker.io/bitnamicharts/postgresql --values bitnami-psql-values.yml --version 16.4.7 -n fossa
helm upgrade -i fossa-sparkle-db oci://registry-1.docker.io/bitnamicharts/postgresql --values bitnami-psql-values.yml --version 16.4.7 -n fossa
helm upgrade -i fossa-hubble-db oci://registry-1.docker.io/bitnamicharts/postgresql --values bitnami-psql-values.yml --version 16.4.7 -n fossa


Set the application to maintenance mode

  1. Set the application to maintenance mode.
helm upgrade -i fossa fossa/fossa-core --set global.maintenanceMode.enabled=true --set vulns.updater.enabled=false --reuse-values

If 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-values

Create database backups

  1. Make a backup of core, hubble and sparkle fossa databases and terminate the port-forward upon completion.

Core

### Core
kubectl port-forward service/fossa-core-postgres 5432:5432 &
pg_dump -h localhost -U fossa -f fossa-core-backup.sql --create
# Terminate the port-forward using `fg` and `Ctrl+C`
fg

Sparkle

kubectl port-forward service/fossa-sparkle-postgres 5432:5432 &
pg_dump -h localhost -U fossa -f fossa-sparkle-backup.sql --create
# Terminate the port-forward using `fg` and `Ctrl+C`
fg

Hubble

kubectl port-forward service/fossa-hubble-postgres 5432:5432 &
pg_dump -h localhost -U fossa -f fossa-hubble-backup.sql --create
# Terminate the port-forward using `fg` and `Ctrl+C`
fg

Restore database backups

  1. Restore the fossa database from the backup for core, hubble and sparkle databases.

Core

### Core
kubectl port-forward service/fossa-core-db-postgresql 5432:5432 &
psql -h localhost -U fossa -d fossa < fossa-core-backup.sql
# Terminate the port-forward using `fg` and `Ctrl+C`
fg

Sparkle

kubectl port-forward service/fossa-sparkle-db-postgresql 5432:5432 &
psql -h localhost -U fossa -d fossa < fossa-sparkle-backup.sql
# Terminate the port-forward using `fg` and `Ctrl+C`
fg

Hubble

kubectl port-forward service/fossa-hubble-db-postgresql 5432:5432 &
psql -h localhost -U fossa -d fossa < fossa-hubble-backup.sql
# Terminate the port-forward using `fg` and `Ctrl+C`
fg

Check the health of the databases

  1. Ensure the core, sparkle and hubble databases are running and healthy.
kubectl logs sts/fossa-core-db-postgresql -f
kubectl logs sts/fossa-sparkle-db-postgresql -f
kubectl logs sts/fossa-hubble-db-postgresql -f


Update the application

  1. Update the release to use the Bitnami database.

Core

helm upgrade -i fossa fossa/fossa-core --set postgres.host=fossa-core-db-postgresql --reuse-values

Sparkle

helm upgrade -i fossa fossa/fossa-sparkle --set sparklePostgres.host=fossa-sparkle-db-postgresql --reuse-values

Hubble

helm upgrade -i fossa fossa/fossa-hubble --set hubble.postgres.host=fossa-hubble-db-postgresql --reuse-values

Set the application to production mode

  1. Set the application to production mode
helm upgrade -i fossa fossa/fossa-core --set global.maintenanceMode.enabled=false --set vulns.updater.enabled=true --reuse-values

If 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-values

Ensure the application is healthy

  1. 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 -f

Update your main values file

  1. Finally after confirming the applications are running and healthy, update your values file to use the new databases.

Core

postgres:
  host: fossa-core-db-postgresql

Sparkle

sparklePostgres:
  host: fossa-sparkle-db-postgresql

Hubble

hubble:
  postgres:
    host: fossa-hubble-db-postgresql