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 dairelease_cr.yaml file.

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

Using an Existing Database

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

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

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

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

Once you have your database up and running, set the following parameters in the values.yaml file:

  • postgresql.install: false—with this setting, the Operator-based installer skips the default PostgreSQL database installation.
  • UseExistingDB.Enabled: true—with this setting, Deploy is being set up to use an existing database.
  • UseExistingDB.XLR_DB_URL: jdbc:postgresql://<postgres-service-name>.<namespace>.svc.cluster.local:5432/<xlr-database-name>—the existing PostgreSQL database server URL
  • UseExistingDB.XLR_DB_USER: Database User for xl-release—PostgreSQL database user name
  • UseExistingDB.XLR_DB_PASS: Database Password for xl-release—PostgreSQL database password
  • UseExistingDB.XLR_REPORT_DB_URL: jdbc:postgresql://<postgres-service-name>.<namespace>.svc.cluster.local:5432/<xl-report-database-name>—the existing PostgreSQL reporting database server URL
  • UseExistingDB.XLR_REPORT_DB_USER: Database User for xl-release-report db—PostgreSQL reporting database user name
  • UseExistingDB.XLR_REPORT_DB_PASS: Database Password for xl-release-report db—PostgreSQL reporting database password

Here’s an example.

UseExistingDB:
  Enabled: true # If you want to use an existing database, change the value to "true". Uncomment the following lines and provide the values.
  XLR_DB_URL: jdbc:postgresql://xlr-production-postgresql.default.svc.cluster.local:5432/<xlr-database-name>
  XLR_DB_USER: <xlr-username>
  XLR_DB_PASS: <xlr-password>
  XLR_REPORT_DB_URL: jdbc:postgresql://xlr-production-postgresql.default.svc.cluster.local:5432/<xl-report-database-name>
  XLR_REPORT_DB_USER: <xl-report-username>
  XLR_REPORT_DB_PASS: <xl-report-password>

Note: If you have your database instance running outside the cluster, configure the parameters above to match your setup.