Configuration of an external database

You can configure an external database for HCL DevOps Test Hub (Test Hub) by using a Helm chart. You can choose to host the database in the same cluster as Test Hub or in a remote cluster. This option gives you the flexibility and control to manage your resources effectively.

Prerequisites

Before you configure the external database, you must ensure that you have completed the following tasks:
  • Installed PostgreSQL 15.
  • Obtained user credentials for the external database with the following permissions:
    • Data manipulation permissions for insert, delete, update, and select.
    • Schema modification permissions to alter a table, create a table, truncate, drop, and create or modify an index.
  • Ensured that the database has sufficient connections. The recommended value for max_connections is 100.

External database support in Test Hub

Test Hub automatically includes and installs a local PostgreSQL server that runs in the same cluster.
Note:
To use an external database, you must provide the database URL in the Helm chart.
Table 1. Helm parameters affecting the external database connection

Parameter

Description

Default value

postgresql.external

Flag to indicate whether the external database connection is used.

false

postgresql.hostname

Hostname or IP address of the external database server.

NA

postgresql.username

Username to access the database.

postgres

postgresql.existingPassword

Password to access the database.

NA

postgresql.port

Port for the database connection.

Note:
This parameter is optional. The default port is 5432. Configure it only if your database uses a different port.

5432

postgresql.params.sslmode

Server certificate validation mode.

Note:
This parameter is optional. The recommended value is verify-full, as it provides the most secure SSL validation.

verify-full

global.privateCaBundleSecretName

Secret name where the self-signed certificates are stored.

NA

Example command
helm upgrade --install {{main}} ./ibm-devops-prod -n devops-system \
  --set global.privateCaBundleSecretName=my-internal-ca-bundle \
  --set postgresql.external=true \
  --set postgresql.hostname=mydbhost.corp.example.com \
  --set postgresql.username=postgres \
  --set postgresql.existingPassword=changeme

Methods for configuring an external database connection

You can configure the Helm chart to connect to an external database by using one of the following methods:

  • Database with a trusted certificate authority
    you must specify the following parameters in the Helm chart:
    --set postgresql.external=true \
    --set postgresql.hostname=kmpg.postgres.database.azure.com \
    --set postgresql.username=theadmin \
    --set postgresql.existingPassword=theadminpassword
    
  • Database within your network by using a self-signed certificate
    You must specify the following parameters in the Helm chart:
    --set global.privateCaBundleSecretName=my-internal-ca-bundle \
    --set postgresql.external=true \
    --set postgresql.hostname=mydbhost.corp.example.com \
    --set postgresql.username=postgres \
    --set postgresql.existingPassword=changeme