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 addressDatabase portDatabase nameDatabase user nameDatabase password
About this task
Procedure
-
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-secretThese variables define the connection details for the external database used by Deploy.
-
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.
-
Set the Helm parameter
database.createDatabase=falseto ensure the deployment does not create a database automatically. -
Update the
HELM_OPTIONSin 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