Configuring Database for Tanzu Application Platform (TAP v1.1) GUI

You might have noticed that when tap-gui pod is restarted, you loose the catalog from TAP GUI and this is the default nature of TAP. In order to persist those entries, you need to configure an external database and update the tap-gui package.

In this post, I will help to with the steps to configure an external database for TAP GUI. I have created an Amazon RDS Postgres database already, Here is the detail of it.

Note: I am not talking about the standard of creating a database and this is out of scope for this post, I have considered a default settings etc for creating an RDS database.

Collect the following entries from database:

  • Host
  • Port
  • Username
  • Password

Once you have collected above details, open the tap-gui.yaml file and update the entries under backend as follows:

Below is the content that you need to put under backend and update the values.

      database:   # This section is needed when you are integrating tap-gui with external db
        client: pg
        connection:
          host: db-host
          port: db-port
          user: db-user
          password: db-pwd
          ssl: {rejectUnauthorized: false} # Set to true if using SSL

Once done, update the tap package.

 tanzu package installed update tap -p tap.tanzu.vmware.com -v 1.1.0 --values-file ../tap11-values.yaml -n tap-install
| Updating installed 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' 

| 'PackageInstall' resource successfully reconciled 
Updated installed package 'tap' in namespace 'tap-install'

Ensure that tap-gui pod is restarted under tap-gui namespace.

kubectl get po -n tap-gui
NAME                      READY   STATUS        RESTARTS   AGE
server-5b88f7f5cc-pp8l9   0/1     Terminating   3          81s
server-7f7fc5bd95-d99xg   1/1     Running       0          3s

Open the TAP GUI and now the catalog entries are coming from the RDS database.

Validating Entries on External Database

  • Login to the postgres database that you have created
psql --host=<> --port=5432 --username=<> --password
postgres=>

Run some queries. listing tables


postgres=> \l
                                           List of databases
            Name             |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------------------------+----------+----------+-------------+-------------+-----------------------
 backstage_plugin_auth       | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 backstage_plugin_catalog    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 backstage_plugin_scaffolder | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 postgres                    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 rdsadmin                    | rdsadmin | UTF8     | en_US.UTF-8 | en_US.UTF-8 | rdsadmin=CTc/rdsadmin+
                             |          |          |             |             | rdstopmgr=Tc/rdsadmin
 template0                   | rdsadmin | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/rdsadmin          +
                             |          |          |             |             | rdsadmin=CTc/rdsadmin
 template1                   | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
                             |          |          |             |             | postgres=CTc/postgres
(7 rows)

So, we are done with configuring database for TAP GUI.

For more information, you can refer VMware official doc below.

https://docs.vmware.com/en/Tanzu-Application-Platform/1.1/tap/GUID-tap-gui-database.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s