Skip to main content
Version: Deploy 23.3

Using an Existing PostgreSQL Database

If you plan to use an existing database—one that is not created by default by the Operator-based installer—you must configure the relevant database parameters in the daideploy_cr.yaml file.

If you have already run Release instance check Migrate to Existing Database

Note: Skip this section if you do not want to use your own database instance. The Digital.ai Deploy Operator creates a PostgreSQL instance by default. This procedure is for those who want to use an existing PostgreSQL database server with Digital.ai Deploy.

Configure an External Database During installation

Create the PostgreSQL database and user in your existing PostgreSQL server if not done already. See the following SQL commands, for example:

CREATE USER <xld-username> WITH
NOSUPERUSER
NOCREATEDB
NOCREATEROLE
ENCRYPTED PASSWORD '<xld-password>';
CREATE USER <xl-report-username> WITH
NOSUPERUSER
NOCREATEDB
NOCREATEROLE
ENCRYPTED PASSWORD '<xl-report-password>';

CREATE DATABASE <xld-database-name>;
CREATE DATABASE <xl-report-database-name>;
GRANT <xld-database-name> TO postgres;
GRANT <xl-report-database-name> TO postgres;

ALTER ROLE <xld-username> WITH PASSWORD '<xld-password>';
ALTER ROLE <xl-report-username> WITH PASSWORD '<xl-report-password>';
ALTER DATABASE <xld-database-name> OWNER to <xld-username>;
ALTER DATABASE <xl-report-database-name> OWNER to <xl-report-username>;

Once you have your database up and running, you can set the following parameters in the daideploy_cr.yaml file. They are set by answering to the question during installation: Edit database external setup:.

Here example of the setup the answer to that question:

  • external.db.main.url: jdbc:postgresql://<postgres-service-name>.<namespace>.svc.cluster.local:5432/<xld-database-name> — the existing PostgreSQL database server URL
  • external.db.main.username: Database User for xl-deploy — PostgreSQL database user name
  • external.db.main.password: Database Password for xl-deploy — PostgreSQL database password
  • external.db.report.url: jdbc:postgresql://<postgres-service-name>.<namespace>.svc.cluster.local:5432/<xl-report-database-name> — the existing PostgreSQL reporting database server URL
  • external.db.report.username: Database User for xl-deploy-report db — PostgreSQL reporting database user name
  • external.db.report.password: Database Password for xl-deploy-report db — PostgreSQL reporting database password

Here's an example of the content that you need to replace with values that referencing your DB:

    main:
url: jdbc:postgresql://xld-production-postgresql.default.svc.cluster.local:5432/<xld-database-name>
username: <xld-username>
password: <xld-password>
report:
url: jdbc:postgresql://xld-production-postgresql.default.svc.cluster.local:5432/<xl-report-database-name>
username: <xl-report-username>
password: <xl-report-password>