Postgres Init Helm Chart

About Postgres Init Helm Chart

Context

The postgres-initarrow-up-right Helm Chart was created to conveniently create a database on an existing PostgreSQL installation. Important to note that the Chart here assumes that PostgreSQL server is already available. The motivation to create this chart were the following:

  • In new OpenG2P deployment model, there is only one instance PostgreSQL server for a given sandbox/deployment/namespace. All databases are created within this server. In previous installations of Registry and PBMS, the Odoo chart would create its own instance of PostgreSQL running as a Pod on cluster. Now that we have externalized the databases, we needed a script to create database aprioriy and then install the respective modules.

  • Harmonising database creation across all modules such that there is a uniform way of creating datasbases.

Functionality

Following functionality is supported:

  • Creation of one or more databases (DB) on an existing PostgreSQL server

  • Creation of one DB user

  • Creation of DB user secret with password on Kuberenetes cluster.

  • Installation of any database extensions like pg_trgm.

The script is idempotent - which means if we run the init again, and if the database, user exist, it won't touch anything and just exit.

For multiple databases the same need to be specified as list item in values.yamlarrow-up-right.

The database user secretarrow-up-right created by this chart is set to 'keep' mode such that it doesn't get deleted if the Helm is uninstalled. This is important 'cause even if the Helm chart is uninstalled the database still exists, and therefore the secret must also exist. If you would like to tear down entire module clean, refer to the tear down instructions below.

Source code

Code of the script, Docker and Helm chart are available herearrow-up-right.

Run

Instructions here pertain to running the Helm chart on command line.

circle-info

Note that you generally will not need to run this Helm from command line as it is alreay embedded in the deployment Helm charts of respective modules.

  • Update / override following params in values.yaml

  • Add list of databases you wish to create:

  • You may add extensions as list like:

  • Run

  • Verify that the database, users, extensions and secrets mentioned in values.yaml have been created,

Tear down

  • Uninstall the Helm chart

  • The above does not delete the database, users and secrets. Delete all these manually:

    • database (via psql)

    • db user (via psql)

    • secret on cluster (via kubectl or Rancher)

Versions

Helm Chart Version
Published Date
Contents

1.0.0

09-Jan-2026

Stable version with following base features:

  • Creation of one or more databases (DB) on an existing Postgres server

  • Creation of DB user

  • Creation of DB user secret with password

0.0.0-develop

In progress

Added feature to optionally install Postgres extensions like pg_trgm . This chart may be used instead of previous one.

Last updated

Was this helpful?