Preparing the database
This section guides you through configuring the persistent database storage for your HCL Digital Experience (DX) IQ Integrator.
Production deployments require a PostgreSQL database to maintain conversation state and session memory across pod restarts and deployments. Select one of the three persistent storage options based on your deployment environment.
Warning
If you do not configure a persistent database, the system defaults to a temporary, in-memory SQLite database that deletes all session data whenever a pod restarts.
Choose from the following database configurations:
- An internal PostgreSQL database provisioned automatically by your DX Persistence Node for Kubernetes-only deployments.
- An external PostgreSQL instance located outside your DX deployment, such as a cloud-managed, on-premises, or separate Kubernetes cluster database.
- A PostgreSQL database provisioned and managed automatically within your DX deployment by your DX Runtime Controller (RTC).
Configuring an internal database
Use this option to automatically provision a PostgreSQL database within your DX deployment. Upgrade the DX deployment to create the database, and then deploy DX IQ to connect to it.
Important
- When upgrading the DX IQ release (
<IQ_RELEASE_NAME>) in this section, always use-f custom-iq-values.yamlwithout--reuse-values. The--reuse-valuesflag can cause configuration drift by preserving old values not in your custom values file. In this topic,<IQ_RELEASE_NAME>is the DX IQ Helm release name (for example,dx-iq). - Use the same
custom-iq-values.yamlfile you created in Deploying DX IQ services. Add the database configuration values shown in this section to that file, then run allhelm upgradecommands with-f custom-iq-values.yaml.
Prerequisites
Before configuring the internal database, verify that your DX deployment (<DX_RELEASE_NAME>) is fully operational within your target namespace (<DX_NAMESPACE>) and includes an active Persistence Node. In this topic, <DX_NAMESPACE> is the Kubernetes namespace where DX is deployed (for example, dxns).
Verifying an existing database setup
If your DX deployment was recently provisioned or upgraded with DX IQ database credentials and networking configuration, the iqdb database and user might already exist. Run the following commands to verify.
-
Check for an existing DX IQ database:
kubectl exec -n <DX_NAMESPACE> <DX_RELEASE_NAME>-persistence-node-0 -c persistence-node -- \ psql -U postgres -c "\l" | grep iq<DX_NAMESPACE>: The DX deployment namespace (for example,dxns).<DX_RELEASE_NAME>: The DX Helm release name.
-
Check for an existing DX IQ user:
kubectl exec -n <DX_NAMESPACE> <DX_RELEASE_NAME>-persistence-node-0 -c persistence-node -- \ psql -U postgres -c "\du" | grep -i iq
If both exist, you can go directly to Deploying DX IQ with database configuration. If either is missing, proceed to the following provisioning section.
Provisioning the database
DX configuration management
The custom-values.yaml file is the primary configuration file for DX deployments. For detailed information on how to create and manage this file, refer to Prepare Configuration.
-
Add the DX IQ database configuration to your DX
custom-values.yamlfile:security: iq: dbUser: "dx_iq_db_user" dbPassword: "<SECURE_PASSWORD>" networking: dxIqService: "<IQ_SERVICE_NAME>"<SECURE_PASSWORD>: A secure password for the DX IQ database user.<IQ_SERVICE_NAME>: The Kubernetes service name for the DX IQ deployment, which typically follows the<IQ_RELEASE_NAME>-integratorformat (for example, if the DX IQ release name isdx-iq, the service name isdx-iq-integrator).
Important
Setting
networking.dxIqServiceenables the Persistence Node to pass theIQ_DB_USERandIQ_DB_PASSWORDenvironment variables to the PostgreSQL initialization script. This is required for automatic database and user creation. -
Upgrade your DX deployment to enable DX IQ database provisioning and automatically generate the database secret:
helm upgrade <DX_RELEASE_NAME> \ https://<YOUR_REPOSITORY_FQDN_AND_PATH>/<DX_HELM_CHART_VERSION>.tgz \ --namespace <DX_NAMESPACE> \ -f custom-values.yaml<DX_RELEASE_NAME>: The DX Helm release name.<YOUR_REPOSITORY_FQDN_AND_PATH>: The repository fully qualified domain name (FQDN) and path.<DX_HELM_CHART_VERSION>: The DX Helm chart version.<DX_NAMESPACE>: The DX deployment namespace (for example,dxns).
Configuration management
Do not use
--reuse-valuesin production environments to prevent configuration drift.To find available Helm chart versions in your repository, search in the user interface or run a
curlcommand. For example, in JFrog Artifactory:curl -u <USERNAME>:<TOKEN> "https://<YOUR_REPOSITORY_FQDN_AND_PATH>/"<USERNAME>: The username for your repository.<TOKEN>: The access token for your repository.
-
Monitor the Persistence Node logs to track database and user initialization:
-
Monitor the Persistence Node logs:
kubectl logs -n <DX_NAMESPACE> <DX_RELEASE_NAME>-persistence-node-0 | grep -i "iq"Output:
Creating IQ user "dx_iq_db_user"... Creating IQ database "iqdb"... -
Run the following command to verify database and user creation:
kubectl exec -n <DX_NAMESPACE> <DX_RELEASE_NAME>-persistence-node-0 -c persistence-node -- \ psql -U postgres -c "\du" | grep dx_iq_db_user
-
Deploying DX IQ with database configuration
-
Update your
custom-iq-values.yamlfile with the database configuration using one of the following options:Add the following
configurationblock to yourcustom-iq-values.yamlfile:configuration: database: enabled: true dbHost: "<DX_RELEASE_NAME>-persistence-node-0.<DX_RELEASE_NAME>-persistence-headless-svc.<DX_NAMESPACE>.svc.cluster.local" dbPort: 5432 dbName: "iqdb" dbUser: "dx_iq_db_user" dbPassword: "<SECURE_PASSWORD>"<DX_RELEASE_NAME>: The DX Helm release name.<DX_NAMESPACE>: The DX deployment namespace (for example,dxns).dbUser: "dx_iq_db_user": The database user name. This name is fixed for the internal database, so use the same value you set in Step 1 of Provisioning the database.<SECURE_PASSWORD>: The samedbPasswordyou configured in Step 1 of Provisioning the database.
Add the following
configurationblock to yourcustom-iq-values.yamlfile, referencing the secret generated by your DX deployment upgrade in Step 2 of Provisioning the database:configuration: database: enabled: true dbHost: "<DX_RELEASE_NAME>-persistence-node-0.<DX_RELEASE_NAME>-persistence-headless-svc.<DX_NAMESPACE>.svc.cluster.local" dbPort: 5432 dbName: "iqdb" dbCustomSecret: "custom-credentials-iq-db"<DX_RELEASE_NAME>: The DX Helm release name.
Same namespace required
This option only works when your DX IQ deployment is in the same Kubernetes namespace as your DX deployment. Kubernetes secrets are namespace-scoped and cannot be referenced across namespaces. If DX IQ is deployed in a different namespace, use the database credentials option.
-
Upgrade your DX IQ deployment with your updated
custom-iq-values.yamlfile:helm upgrade <IQ_RELEASE_NAME> \ https://<YOUR_REPOSITORY_FQDN_AND_PATH>/<IQ_HELM_CHART_VERSION>.tgz \ --namespace <DX_NAMESPACE> \ -f custom-iq-values.yaml<IQ_RELEASE_NAME>: The DX IQ Helm release name (for example,dx-iq).<YOUR_REPOSITORY_FQDN_AND_PATH>: The repository FQDN and path.<IQ_HELM_CHART_VERSION>: The DX IQ Helm chart version.
-
Verify that the database credentials are configured based on your chosen configuration option:
Verify that the ConfigMap was created:
kubectl get configmap -n <DX_NAMESPACE> <IQ_RELEASE_NAME>-integrator kubectl describe configmap -n <DX_NAMESPACE> <IQ_RELEASE_NAME>-integratorVerify that the referenced DX secret exists in the namespace:
kubectl get secret -n <DX_NAMESPACE> custom-credentials-iq-db kubectl describe secret -n <DX_NAMESPACE> custom-credentials-iq-db
Configuring an external database
Use this option to connect to an existing PostgreSQL database located outside of your DX deployment. Create a Kubernetes secret to store the credentials, and then deploy DX IQ to connect to it.
Network connectivity requirement
Your Kubernetes cluster must have outbound network access to reach the external database server. If your cluster is isolated or behind a firewall, ensure:
- Egress rules allow outbound traffic on the database port (TCP port 5432 for PostgreSQL).
- Security groups (AWS) or firewall rules (GCP or Azure) permit connections to the external database host.
- Network policies allow egress traffic to external networks when using Calico or another Container Network Interface (CNI).
If connectivity fails with ENETUNREACH or Network is unreachable errors, contact your infrastructure team to enable outbound access to the external database.
-
Create a Kubernetes secret to store your external database credentials:
kubectl create secret generic <DB_SECRET_NAME> \ --namespace <DX_NAMESPACE> \ --from-literal=username=<DB_USERNAME> \ --from-literal=password=<DB_PASSWORD><DB_SECRET_NAME>: The name of the Kubernetes secret that stores the external database credentials (for example,custom-external-db-credentials).<DX_NAMESPACE>: The Kubernetes namespace where DX is deployed (for example,dxns).<DB_USERNAME>: The database username.<DB_PASSWORD>: The database password.
-
Verify that the secret was created successfully:
kubectl get secret <DB_SECRET_NAME> -n <DX_NAMESPACE> kubectl describe secret <DB_SECRET_NAME> -n <DX_NAMESPACE> -
Update your
custom-iq-values.yamlfile to define the external database connection settings, referencing the secret name (<DB_SECRET_NAME>) from Step 1:configuration: database: enabled: true dbHost: "<EXTERNAL_DB_HOST>" dbPort: 5432 dbName: "<DB_NAME>" dbCustomSecret: "<DB_SECRET_NAME>"-
<EXTERNAL_DB_HOST>: The hostname or IP address of the external PostgreSQL server. For example:External server Values AWS RDS PostgreSQL iq-postgres.c9akciq32.us-east-1.rds.amazonaws.comAzure Database for PostgreSQL myserver.postgres.database.azure.comGoogle Cloud SQL Use Cloud SQL Auth proxy or instance IP (for example, 10.0.1.5)Different Kubernetes cluster The fully qualified DNS name or IP address of the PostgreSQL server accessible from the cluster network On-premises or external The reachable hostname or IP address (for example, postgres.company.internalor192.168.1.50) -
<DB_NAME>: The name of the DX IQ database. <DB_SECRET_NAME>: The secret name from Step 1.
-
-
Upgrade your DX IQ deployment with your updated
custom-iq-values.yamlfile:helm upgrade <IQ_RELEASE_NAME> \ https://<YOUR_REPOSITORY_FQDN_AND_PATH>/<IQ_HELM_CHART_VERSION>.tgz \ --namespace <DX_NAMESPACE> \ -f custom-iq-values.yaml<IQ_RELEASE_NAME>: The DX IQ Helm release name (for example,dx-iq).<YOUR_REPOSITORY_FQDN_AND_PATH>: The repository FQDN and path.<IQ_HELM_CHART_VERSION>: The DX IQ Helm chart version.
-
Upgrade your DX deployment to enable DX IQ:
-
Retrieve your current DX deployment Helm chart version:
helm list -n <DX_NAMESPACE> helm get all <DX_RELEASE_NAME> --namespace <DX_NAMESPACE> -
Add the DX IQ service configuration to your DX
custom-values.yamlfile:networking: dxIqService: "<IQ_SERVICE_NAME>"<IQ_SERVICE_NAME>: The Kubernetes service name for the DX IQ deployment, which typically follows the<IQ_RELEASE_NAME>-integratorformat (for example, if the DX IQ release name isdx-iq, the service name isdx-iq-integrator). -
Upgrade the DX deployment with your updated
custom-values.yamlfile:helm upgrade <DX_RELEASE_NAME> \ https://<YOUR_REPOSITORY_FQDN_AND_PATH>/<DX_HELM_CHART_VERSION>.tgz \ --namespace <DX_NAMESPACE> \ -f custom-values.yaml<DX_RELEASE_NAME>: The DX Helm release name (for example,dx-deployment).<DX_HELM_CHART_VERSION>: The DX Helm chart version.
Configuration management
Always use your
custom-values.yamlfile for configuration changes instead of--setflags. For more information refer to Prepare configuration.To find available Helm chart versions in your repository, search in the user interface or run a
curlcommand. For example, in JFrog Artifactory:curl -u <USERNAME>:<TOKEN> "https://<YOUR_REPOSITORY_FQDN_AND_PATH>/"<USERNAME>: The username for your repository.<TOKEN>: The access token for your repository.
-
Configuring an RTC-managed database
Use this option to automatically provision and manage a PostgreSQL database within the DX deployment using the DX RTC.
-
Create the DX IQ database credentials secrets:
-
Delete the existing DX IQ database credentials secrets if they exist from a previous installation:
kubectl delete secret custom-credentials-iq-db -n <DX_NAMESPACE> --ignore-not-found kubectl delete secret <DX_RELEASE_NAME>-custom-credentials-iq-db -n <DX_NAMESPACE> --ignore-not-found kubectl delete secret <DX_RELEASE_NAME>custom-credentials-iq-db-previous-value -n <DX_NAMESPACE> --ignore-not-found<DX_NAMESPACE>: The DX deployment namespace (for example,dxns).<DX_RELEASE_NAME>: The DX Helm release name (for example,dx-deployment).
-
Create the new secrets:
-
Create the base secret:
kubectl create secret generic custom-credentials-iq-db \ --namespace <DX_NAMESPACE> \ --from-literal=username=<DB_USERNAME> \ --from-literal=password=<DB_PASSWORD><DB_USERNAME>: The database username.<DB_PASSWORD>: The database password.
-
Create the release-specific secret:
kubectl create secret generic <DX_RELEASE_NAME>-custom-credentials-iq-db \ --namespace <DX_NAMESPACE> \ --from-literal=username=<DB_USERNAME> \ --from-literal=password=<DB_PASSWORD> -
Create the previous-value secret:
kubectl create secret generic <DX_RELEASE_NAME>custom-credentials-iq-db-previous-value \ --namespace <DX_NAMESPACE> \ --from-literal=username=<DB_USERNAME> \ --from-literal=password=<DB_PASSWORD>
-
-
-
Verify that the secrets were created:
-
Verify that the base secret exists:
kubectl get secret custom-credentials-iq-db -n <DX_NAMESPACE> kubectl describe secret custom-credentials-iq-db -n <DX_NAMESPACE> -
Verify that the release-specific secret exists:
kubectl get secret <DX_RELEASE_NAME>-custom-credentials-iq-db -n <DX_NAMESPACE> kubectl describe secret <DX_RELEASE_NAME>-custom-credentials-iq-db -n <DX_NAMESPACE> -
Verify that the previous-value secret exists:
kubectl get secret <DX_RELEASE_NAME>custom-credentials-iq-db-previous-value -n <DX_NAMESPACE> kubectl describe secret <DX_RELEASE_NAME>custom-credentials-iq-db-previous-value -n <DX_NAMESPACE>
-
-
Upgrade the DX deployment to enable RTC database management for DX IQ:
-
Retrieve the current DX deployment Helm chart version:
helm list -n <DX_NAMESPACE> helm get all <DX_RELEASE_NAME> --namespace <DX_NAMESPACE> -
Add the RTC database configuration to your DX
custom-values.yamlfile:configuration: digitalAssetManagement: newDbManagement: true networking: dxIqService: "<IQ_SERVICE_NAME>" security: iq: customDbSecret: "custom-credentials-iq-db"<IQ_SERVICE_NAME>: The Kubernetes service name for the DX IQ deployment, which typically follows the<IQ_RELEASE_NAME>-integratorformat (for example, if the DX IQ release name isdx-iq, the service name isdx-iq-integrator). -
Upgrade the DX deployment with your updated
custom-values.yamlfile:helm upgrade <DX_RELEASE_NAME> \ https://<YOUR_REPOSITORY_FQDN_AND_PATH>/<DX_HELM_CHART_VERSION>.tgz \ --namespace <DX_NAMESPACE> \ -f custom-values.yaml<YOUR_REPOSITORY_FQDN_AND_PATH>: The repository FQDN and path to specified package or image.<DX_HELM_CHART_VERSION>: The DX Helm chart version.
To find available Helm chart versions in your repository, search in the user interface or run a
curlcommand. For example, in JFrog Artifactory:curl -u <USERNAME>:<TOKEN> "https://<YOUR_REPOSITORY_FQDN_AND_PATH>/"<USERNAME>: The username for your repository.<TOKEN>: The access token for your repository.
-
-
Monitor the RTC logs to track database creation:
kubectl logs -n <DX_NAMESPACE> deployment/<DX_RELEASE_NAME>-runtime-controller | grep -i "iq"Output:
IQ database setup completed successfully.To verify persistence layer initialization:
kubectl logs -n <DX_NAMESPACE> deployment/<DX_RELEASE_NAME>-runtime-controller | grep -E "persistence|pgpool" -
After the RTC pod is running and the database is initialized, run a shell script to configure
pgpoolto recognize the DX IQ database user:-
Create the
add-iq-user-to-pgpool.shscript file:#!/bin/bash IQ_USER="<DB_USERNAME>" IQ_PASS="<DB_PASSWORD>" POD_NAME=$(kubectl get pods -n <DX_NAMESPACE> -l app=<DX_RELEASE_NAME>-persistence-connection-pool -o jsonpath='{.items[0].metadata.name}') NAMESPACE="<DX_NAMESPACE>" echo "1. Generating MD5 hash..." HASH=$(echo -n "${IQ_PASS}${IQ_USER}" | md5sum | awk '{print $1}') echo "2. Appending credentials to ${POD_NAME}..." kubectl exec -n $NAMESPACE $POD_NAME -- sh -c "echo '${IQ_USER}:md5${HASH}' >> /conf/pool_passwd" echo "3. Reloading PgPool configuration smoothly..." # Automatically finds the main parent PgPool process and sends the reload signal kubectl exec -n $NAMESPACE $POD_NAME -- sh -c 'kill -HUP $(ps -o pid,args | grep "[b]in/pgpool" | awk "{print \$1}")' echo "Done! Current configuration:" kubectl exec -n $NAMESPACE $POD_NAME -- tail -n 1 /conf/pool_passwd -
Make the script executable:
chmod +x add-iq-user-to-pgpool.sh -
Run the script:
./add-iq-user-to-pgpool.shExpected output:
1. Generating MD5 hash... 2. Appending credentials to dx-deployment-persistence-connection-pool-666c7d8476-qn2s9... 3. Reloading PgPool configuration smoothly... Done! Current configuration: -
Verify that the DX IQ user was added to the
pgpoolconfiguration:POD_NAME=$(kubectl get pods -n <DX_NAMESPACE> -l app=<DX_RELEASE_NAME>-persistence-connection-pool -o jsonpath='{.items[0].metadata.name}') kubectl exec -n <DX_NAMESPACE> $POD_NAME -- cat /conf/pool_passwdVerify that the output includes the DX IQ user entry with the MD5 hash (for example,
<DB_USERNAME>:md5<HASH_VALUE>, where<HASH_VALUE>is the MD5 hash that the script generates).
-
-
Verify that the database, user, environment variables, and secrets are successfully created and configured:
-
Confirm the database and user roles exist in the persistence node:
kubectl exec -n <DX_NAMESPACE> <DX_RELEASE_NAME>-persistence-node-0 -c persistence-node -- \ psql -U postgres -c "\l" | grep iqkubectl exec -n <DX_NAMESPACE> <DX_RELEASE_NAME>-persistence-node-0 -c persistence-node -- \ psql -U postgres -c "\du" | grep iq -
Confirm the database management flags are active and the credentials secret exists:
kubectl exec -n <DX_NAMESPACE> deployment/<DX_RELEASE_NAME>-runtime-controller -- env | grep -E "IQ_|NEW_DB" kubectl get secret custom-credentials-iq-db -n <DX_NAMESPACE>
-
-
Update your
custom-iq-values.yamlfile with the RTC-managed database configuration:Important
The
dbNamemust beiqdb. This is the fixed name that the RTC creates. Do not use a custom name.configuration: database: enabled: true dbHost: "<DX_RELEASE_NAME>-persistence-node-0.<DX_RELEASE_NAME>-persistence-headless-svc.<DX_NAMESPACE>.svc.cluster.local" dbPort: 5432 dbName: "iqdb" dbCustomSecret: "custom-credentials-iq-db"Different namespaces
The DX IQ chart reads the
custom-credentials-iq-dbsecret from the namespace where DX IQ is deployed. If DX IQ is deployed in a different namespace than DX, also create thecustom-credentials-iq-dbsecret in the DX IQ namespace. -
Upgrade the DX IQ deployment with your updated
custom-iq-values.yamlfile:helm upgrade <IQ_RELEASE_NAME> \ https://<YOUR_REPOSITORY_FQDN_AND_PATH>/<IQ_HELM_CHART_VERSION>.tgz \ --namespace <DX_NAMESPACE> \ -f custom-iq-values.yaml<IQ_RELEASE_NAME>: The DX IQ Helm release name (for example,dx-iq).<IQ_HELM_CHART_VERSION>: The DX IQ Helm chart version.
Next steps
After configuring your database:
- Verify that the DX IQ pod can connect to the database successfully.
- Configure DX IQ Integrator authentication for LiteLLM access.
- Run regular backups to ensure data recovery if a failure occurs.