Configuring an external database for Test

You can configure an external PostgreSQL database for the Test capability in DevOps Loop and provide the database connection details in the Helm chart so that Test connects to the external database instead of using the PostgreSQL instance that is installed in the cluster by default.

Before you begin

You must have completed the following tasks:

  • Prepared the external PostgreSQL instance, and ensured that it is accessible from the Kubernetes cluster.
  • Ensured that the database user has permissions for insert, update, delete, select, and schema modifications (create, alter, drop tables and indexes).

  • Ensured that the Kubernetes cluster can reach the database host and port.

  • Ensured that the following information is available:
    • Database host name or IP address
    • Database port (default: 5432)
    • Database name
    • Database user name
    • Database password

About this task

You must update the installation script so that the Test capability connects to the external database. The modifications include defining database variables and passing the database parameters to Helm during installation.

Procedure

  1. Add the required external database variables to the beginning of the installation script:
    TEST_DB_HOST=<database-host>
    TEST_DB_PORT=5432
    TEST_DB_NAME=testhubdb
    TEST_DB_USER=postgres
    TEST_DB_PASSWORD=<database-password>
    TEST_CA_SECRET=<ca-secret-name>   # Optional, if using self-signed certificates

    These variables define the connection details for the external PostgreSQL database used by the Test.

  2. Update the HELM_OPTIONS in the script to include the external database connection parameters:
    HELM_OPTIONS="${HELM_OPTIONS} \
    --set hcl-devops.postgresql.external=true \
    --set hcl-devops.postgresql.hostname=${TEST_DB_HOST} \
    --set hcl-devops.postgresql.port=${TEST_DB_PORT} \
    --set hcl-devops.postgresql.username=${TEST_DB_USER} \
    --set hcl-devops.postgresql.existingPassword=${TEST_DB_PASSWORD}"
    Note:
    By default the sslmode is set to verify-full.

    If the database uses a self-signed certificate, add the following parameter:

    --set hcl-devops-prod.global.privateCaBundleSecretName=${TEST_CA_SECRET}

Results

After you run the installation script, DevOps Loop is installed and the Test capability connects to the external PostgreSQL database by using the parameters defined in the script.

What to do next

You must install DevOps Loop to apply the configuration. See Installation of DevOps Loop.