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, use CloudNativePG to manage a high-availability PostgreSQL cluster inside the LKE cluster.
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 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 LKE. See Deploy Hydrolix on LKE.
- kubectl configured to access the LKE cluster.
- Object storage for CloudNativePG WAL archiving and backups.
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:
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 | |
|---|---|