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.
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
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.
-
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.
-
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=false to ensure
the deployment does not create a database automatically.
-
Update the
HELM_OPTIONS in the script to include the external
database connection parameters:
HELM_OPTIONS="${HELM_OPTIONS} \
--set ibm-ucd-prod.database.type=${DB_TYPE} \
--set ibm-ucd-prod.database.hostname=${DB_HOST} \
--set ibm-ucd-prod.database.port=${DB_PORT} \
--set ibm-ucd-prod.database.name=${DB_NAME} \
--set ibm-ucd-prod.database.username=${DB_USER} \
--set ibm-ucd-prod.database.createDatabase=false \
--set ibm-ucd-prod.secret.name=${DB_SECRET} \
--set ibm-ucd-prod.database.fetchDriver=true"
Note: Add the following Helm parameter to ensure the
Deploy server automatically downloads the required JDBC
driver:
--set ibm-ucd-prod.database.fetchDriver=true"
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.
You must install DevOps Loop to apply the configuration.
See Installation of DevOps Loop.