Configure the Tanzu Application Platform GUI database

The Tanzu Application Platform GUI catalog allows for two approaches for storing catalog information:

  • In-memory database: The default option uses an in-memory database and is suitable for test and development scenarios only. The in-memory database reads the catalog data from Git URLs that you write in tap-values.yaml.

    This data is temporary. Any operations that cause the server pod in the tap-gui namespace to be re-created also cause this data to be rebuilt from the Git location.

    This can cause issues when you manually register entities by using the UI because they only exist in the database and are lost when that in-memory database is rebuilt. If you choose this method, you lose all user preferences and any manually registered entities when the Tanzu Application Platform GUI server pod is re-created.

  • PostgreSQL database: For production use-cases, use a PostgreSQL database that exists outside the Tanzu Application Platform packaging. The PostgreSQL database stores all the catalog data persistently both from the Git locations and the UI manual entity registrations.

For production or general-purpose use-cases, a PostgreSQL database is recommended.

Configure a PostgreSQL database

See the following sections for configuring Tanzu Application Platform GUI to use a PostgreSQL database.

Edit tap-values.yaml

Apply the following values in tap-values.yaml:

backend:
  baseUrl: http://tap-gui.INGRESS-DOMAIN
  cors:
    origin: http://tap-gui.INGRESS-DOMAIN
# Existing tap-values.yaml above
  database:
    client: pg
    connection:
      host: PG-SQL-HOSTNAME
      port: 5432
      user: PG-SQL-USERNAME
      password: PG-SQL-PASSWORD
      ssl: {rejectUnauthorized: false} # Set to true if using SSL

Where:

  • PG-SQL-HOSTNAME is the host name of your PostgreSQL database
  • PG-SQL-USERNAME is the user name of your PostgreSQL database
  • PG-SQL-PASSWORD is the password of your PostgreSQL database

(Optional) Configure extra parameters

Beyond the minimum configuration options needed to make Tanzu Application Platform GUI work with the pg driver, there are many more configuration options for other purposes. For example, you can restrict Tanzu Application Platform GUI to a single database. For more information about this restriction, see the Backstage documentation.

By default, Tanzu Application Platform GUI creates a database for each plug-in, but you can configure it to divide plug-ins based on different PostgreSQL schemas and use a single specified database.

See the following example of extra configuration parameters:

backend:
  # ... other backend details
  database:
    client: pg

    # This parameter tells Tanzu Application Platform GUI to put plug-ins in their own schema instead
    # of their own database.
    # default: database
    pluginDivisionMode: schema

    connection:
      # ... other connection details
      database: PG-SQL-DATABASE

Where PG-SQL-DATABASE is the database name for Tanzu Application Platform GUI to use

For the complete list of these configuration options, see the node-postgres documentation.

Update the package profile

You can apply your new configuration by updating Tanzu Application Platform with your modified values. Doing so updates Tanzu Application Platform GUI because it belongs to Tanzu Application Platform.

To apply your new configuration, run:

tanzu package installed update  tap --package-name tap.tanzu.vmware.com --version VERSION-NUMBER --values-file tap-values.yaml -n tap-install

Where VERSION-NUMBER is your Tanzu Application Platform version. For example, 1.3.6.

For example:

$ tanzu package installed update  tap --package-name tap.tanzu.vmware.com --version 1.3.6 --values-file tap-values.yaml -n tap-install
| Updating package 'tap'
| Getting package install for 'tap'
| Getting package metadata for 'tap.tanzu.vmware.com'
| Updating secret 'tap-tap-install-values'
| Updating package install for 'tap'
/ Waiting for 'PackageInstall' reconciliation for 'tap'


Updated package install 'tap' in namespace 'tap-install'
check-circle-line exclamation-circle-line close-line
Scroll to top icon