Configuring an external database for Plan and Control
You can configure an external PostgreSQL database for the Plan capability in DevOps Loop and provide the database connection details in the Helm chart so that Plan connects to the external database instead of using the default PostgreSQL service included with the chart.
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 addressDatabase port (default: 5432)Database nameDatabase user nameDatabase password
About this task
Procedure
-
Add the required external database variables at the beginning of the
installation script:
PLAN_DB_HOST=<database-host> PLAN_DB_PORT=5432 PLAN_DB_NAME=plan_db PLAN_DB_USER=plan_user PLAN_DB_PASSWORD=<database-password>These variables define the connection details for the external PostgreSQL database used by Plan.
-
Set the Helm parameter
postgresql.enabled=falseto ensure the deployment does not create a database automatically. -
Create a
devopsplan.yamlfile that defines the external database connection, tenant datastore, and disables the internal PostgreSQL service:## Spring datastore settings (PostgreSQL) ibm-devopsplan-prod: spring: datastore: url: "jdbc:postgresql://${PLAN_DB_HOST}:${PLAN_DB_PORT}/${PLAN_DB_NAME}" username: ${PLAN_DB_USER} password: ${PLAN_DB_PASSWORD} ## Tenant datastore settings (PostgreSQL) tenant: datastore: server: ${PLAN_DB_HOST} dbname: ${PLAN_DB_NAME} username: ${PLAN_DB_USER} password: ${PLAN_DB_PASSWORD} ## Optional SMTP settings global: platform: smtp: sender: ${EMAIL_FROM_ADDRESS} host: ${EMAIL_SERVER_HOST} port: ${EMAIL_SERVER_PORT} username: ${EMAIL_SERVER_USERNAME} password: ${EMAIL_SERVER_PASSWORD} postgresql: enabled: false ## CONTROL external database settings control: postgresql: host: "CONTROL_DB_HOST" dbName: "CONTROL_DB_NAME" username: "CONTROL_DB_USER" password: "CONTROL_DB_PASSWORD" postgresql: enabled: false -
Update the Helm install or upgrade command to use the external database by
including the devopsplan.yaml file:
helm upgrade devops-loop oci://hclcr.io/launch-helm/hcl-launch-plan-prod \ --install \ --namespace ${NAMESPACE} \ -f devopsplan.yaml
Results
devopsplan.yaml file