PostgreSQL ΒΆ

Migration in progress β€” do not create new databases

The Zalando postgres-operator is being replaced by CloudNativePG. Do not create new Postgres databases using this operator. Existing databases will be migrated automatically.

If you need a new PostgreSQL database today, use Cloud SQL instead. We'll announce when CloudNativePG is ready for new databases.

Experimental feature

This feature is an alpha feature, and is subject to API change, instability or removal. Some features may not be fully developed, and changes will be made in the coming months.

Plaintext

PostgreSQL is a relational database which is a good choice for storing data that is relational in nature. In the nais platform, PostgreSQL databases are currently managed by the Zalando postgres-operator, which is being migrated to CloudNativePG.

Minimal configuration needed to provision a database for your application:

postgres.yaml

The default configuration sets up the cluster with:

  • no automatic storage increase
  • primary and replica (in production we recommend using high availability which offers a primary and two replicas)
  • automatic backups

See all configuration options in the Postgres manifest reference.

Choosing the right resources for production

The minimal configuration above creates a database cluster with limited resources. Change these resources to suit your purposes for your production databases.

Please also note that automatic storage increase is not currently available.

How it works ΒΆ

The first time you deploy the Postgres resource with the above configuration, Nais will provision the database into your team's postgres namespace (team namespace prefixed with pg-). Your team has full access to view logs and perform administrative database tasks and maintenance.

The application spec.postgres.clusterName field in your Application manifest should reference the name of the Postgres resource to link the database to your application.

Nais also configures your application with the necessary environment variables needed to connect to the database. See the reference for the list of environment variables.

First time provisioning of the database will take a few minutes. Your application will not be able to connect to the database until the provisioning is complete.