Configuring an external database for Deploy

You can configure an external database for the Deploy capability in DevOps Loop and provide the database connection details in the Helm chart so that Deploy connects to the external database instead of creating one within the cluster.

Before you begin

You must have completed following tasks:

  • Prepared the external PostgreSQL instance, and ensured that it is accessible from the Kubernetes cluster.
  • Ensured that the database user has permission to access the database.
  • Ensured that the Kubernetes cluster can reach the database host and port.
  • Ensured that the required JDBC driver is available for the database.
  • The following information is available:
    • Database type (MySQL, Db2, Oracle, or SQL Server)
    • Database host name or IP address
    • Database port
    • Database name
    • Database user name
    • Database password

About this task

You must update the installation script so that Deploy connects to the external database. The modifications include defining database variables, creating a Kubernetes secret for the database credentials, and passing the database parameters to Helm during installation.

Procedure

  1. Add the required external database variables to the beginning of the installation script:
    DB_TYPE=mysql
    DB_HOST=<database-host>
    DB_PORT=3306
    DB_NAME=deploydb
    DB_USER=dbuser
    DB_PASSWORD=<database-password>
    DB_SECRET=ucd-db-secret

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

  2. Create a Kubernetes secret for the database password.
    kubectl create secret generic ${DB_SECRET} \
      --namespace ${NAMESPACE} \
      --from-literal=dbpassword="${DB_PASSWORD}"

    The Deploy server reads the database password from this secret during initialization.

  3. Set the Helm parameter database.createDatabase=false to ensure the deployment does not create a database automatically.
  4. Update the HELM_OPTIONS in the script to include the external database connection parameters:
    HELM_OPTIONS="${HELM_OPTIONS} \
    --set hcl-launch-server-prod.database.type=${DB_TYPE} \
    --set hcl-launch-server-prod.database.hostname=${DB_HOST} \
    --set hcl-launch-server-prod.database.port=${DB_PORT} \
    --set hcl-launch-server-prod.database.name=${DB_NAME} \
    --set hcl-launch-server-prod.database.username=${DB_USER} \
    --set hcl-launch-server-prod.database.createDatabase=false \
    --set hcl-launch-server-prod.secret.name=${DB_SECRET} \
    --set hcl-launch-server-prod.database.fetchDriver=true"
    Note:
    Add the following Helm parameter to ensure the Deploy server automatically downloads the required JDBC driver:
    --set hcl-launch-server-prod.database.fetchDriver=true

Results

After you run the installation script, DevOps Loop is installed, and the Deploy capability connects to the external 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.