Deploy Production PostgreSQL
Hydrolix provisions a single internal PostgreSQL pod to store the catalog. This default configuration has no high availability or automated backups and isn't suitable for production.
For production deployments, choose an option:
- CloudNativePG: Manages a high-availability PostgreSQL cluster inside the AKS cluster. Best for deployments that keep all components in Kubernetes and back up to object storage.
- Azure Database for PostgreSQL: A fully managed PostgreSQL service in Azure. Best for deployments that prefer an externally managed database with Azure-native backups and maintenance.
New deployments don't require migration
For new Hydrolix installations, complete all steps on this page after deploying the Operator and HydrolixCluster resource, but before ingesting any data. The Operator creates the required databases, users, and permissions on the external or CNPG instance. No migration is needed.
Existing deployments require migration
Switching an existing deployment from the internal PostgreSQL pod to an external database requires a catalog migration. Catalog loss can lead to data becoming unrecoverable. Contact Hydrolix support and review Migrate to External PostgreSQL before proceeding.
Prerequisites⚓︎
- A Hydrolix deployment on AKS. See Deploy Hydrolix on AKS.
- kubectl configured to access the AKS cluster.
For Azure Database for PostgreSQL, also:
- Azure CLI installed and authenticated with permission to create resources in the AKS resource group.
Deploy high-availability PostgreSQL in Kubernetes⚓︎
Use CloudNativePG (CNPG) to manage a high-availability PostgreSQL cluster in Kubernetes. CNPG is external to Hydrolix.
-
Install the CNPG operator. See Installation and upgrades - CloudNativePG for instructions.
-
Create a
catalog.yamlfile with this minimal configuration:backup: Specify an object storage path for archiving Write-Ahead Logging (WAL) files and backups. See Appendix C - Common object stores for backups - CloudNativePG for supported options.owner: query_api: The PostgreSQL role that owns the catalog database. Hydrolix uses this role internally - don't change this value.enableSuperuserAccess: Must betrueso Hydrolix can log in with the root user to create the Keycloak and Config API databases and users.
-
Apply the Cluster object and wait for the status to show as healthy.
Apply and Verify Catalog Cluster A healthy cluster shows
Cluster in healthy statein theSTATUScolumn with all instances ready:
Configure Azure Database for PostgreSQL⚓︎
New deployments only
This section explains how to configure a new Hydrolix deployment to use an external PostgreSQL instance. To migrate an existing deployment, see Migrate to External PostgreSQL.
Configure an Azure Database for PostgreSQL flexible server instance in the same virtual network (VNet) as the AKS cluster. Deploy the instance without a public IP address, and in the same region as the AKS cluster for best performance. Size the instance based on the criteria in Scale profiles. For example, at Mega scale, provision an instance with 100 GB disk, six CPUs, and 24 GB of memory.
-
Create the flexible server instance.
Create Flexible Server Instance -
Create the Hydrolix database.
-
Note the hostname Azure provides for the server. Use this hostname as the
catalog_db_hostvalue when editing the HydrolixCluster resource.
Define the external PostgreSQL connection⚓︎
Disable the internal PostgreSQL instance and configure Hydrolix to connect to the external PostgreSQL endpoint.
-
Edit the HydrolixCluster resource.
Edit HydrolixCluster -
Fill in the values for
catalog_db_admin_user,catalog_db_admin_db, andcatalog_db_host. Setscale.postgres.replicasto0.- For CloudNativePG, use
catalog-rwas thecatalog_db_hostvalue. This is the CNPG read-write service endpoint that routes to the primary instance. - For an external managed PostgreSQL service, use the endpoint the cloud provider supplies.
- For CloudNativePG, use
Create the secret⚓︎
Store the PostgreSQL credentials in a curated Kubernetes secret.
If using CloudNativePG, retrieve the auto-generated passwords first.
| Retrieve CNPG Passwords | |
|---|---|
-
Edit the
curatedsecret.Edit Curated Secret -
Add the
stringDataproperty with the required credentials. Kubernetes encodes values fromstringDataand stores them indata. When reading thecuratedsecret, only thedatakey is present.For CloudNativePG, include both passwords:
CNPG Credentials for curated Secret For an externally managed PostgreSQL service, include only the admin password set when creating the instance:
New and existing deployments
The Operator picks up the secret on first deploy for new deployments.
If the Hydrolix cluster is already running, restart all deployments to apply the new credentials. Secret changes don't trigger automatic restarts.
| Restart All Deployments | |
|---|---|