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 EKS cluster. Best for deployments that keep all components in Kubernetes and back up to object storage.
- Amazon RDS: A fully managed PostgreSQL service in AWS. Best for deployments that prefer an externally managed database with AWS-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 EKS. See Deploy Hydrolix on EKS.
- kubectl configured to access the EKS cluster.
For Amazon RDS, also:
- AWS CLI installed and authenticated with permission to create RDS instances in the EKS account and region.
Deploy high-availability PostgreSQL in Kubernetes⚓︎
Use CloudNativePG (CNPG) to manage a high-availability PostgreSQL cluster in Kubernetes. CNPG is external to Hydrolix. Alternatively, set up an RDS instance in the same account as the EKS cluster.
-
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 RDS PostgreSQL⚓︎
The RDS PostgreSQL instance must be in the same account, VPC, and AWS region as the EKS cluster.
Find the cluster VPC ID
| Get Cluster VPC ID | |
|---|---|
- Navigate to the AWS console.
- Search for and select Aurora and RDS.
- Click Create a database, then select Full configuration.
- Select PostgreSQL as the engine type and choose a version from the menu. Amazon defaults to the latest stable version.
- Select the Production template.
- Select Multi-AZ DB instance for availability and durability.
- Configure these sections:
- Settings: Enter a name in the DB instance identifier field.
- Credentials Settings: Enter a master username and password. Hydrolix uses these to access the database.
- Storage: Select General Purpose SSD (gp3) with 100 GiB of allocated storage.
- Connectivity: Select the VPC associated with the EKS cluster and the default DB Subnet group.
- VPC security group: Select Choose existing and add both the EKS cluster and node security groups.
- Disable:
- Monitoring > Enable Performance Insights
- Additional configuration > Enable auto minor version upgrade
- Review any remaining sections and adjust settings for your environment as needed, such as credential management or log exports.
- Click Create database.
It takes about 10 minutes to create the database. When ready, AWS provides an endpoint to connect to the database. Find this endpoint in the Connectivity & security tab of the database details page. Use this endpoint as the catalog_db_host value 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 | |
|---|---|