PostgreSQL

It is possible to deploy Immuta without the use of cloud-provided managed services by using enterprise-ready tools for Kubernetes.

This article describes deploying a PostgreSQL cluster in the Immuta installation namespace using CloudNativePGarrow-up-right (CNPG), a CNCF Sandbox project that manages the full lifecycle of highly available PostgreSQL clusters on Kubernetes.

Deploying CloudNativePG

This section relies on the CloudNativePG official documentation found at the link below.

Install the operator

Verify the operator is running:

circle-info

If you are upgrading an existing CNPG installation, add the --force-conflicts flag to take ownership of the CRD fields from the previous installation:

Deploy a PostgreSQL cluster

The following manifest creates a single-instance PostgreSQL 16 cluster with the immuta, temporal, and temporal_visibility databases required by Immuta. The pgcrypto extension is installed automatically in the immuta database.

circle-info

postInitSQL runs against the postgres database as the superuser, which is why CREATE DATABASE statements are placed there. postInitApplicationSQL runs against the immuta database, where the pgcrypto extension is needed.

Verifying cluster health

Configure databases

After the cluster is healthy, create the btree_gin extension in the temporal_visibility database:

Validate connectivity

The immuta user password is stored in the secret created automatically by CNPG.

Forward the port in a separate terminal:

In the original terminal with the password set, connect using psql:

Verify the databases, extensions, and search path:

Immuta Helm Values

Use the following postgresql configuration in your Immuta Helm values to connect to the in-cluster CNPG deployment. The immuta user password is stored in the secret created automatically by CNPG.

Last updated