Skip to main content

PostgresCluster

resourceType postgresql · provider cnpg · default provider (omit provider to get this one) · sharing Private · cleanup Orphan

Provisions a dedicated CloudNativePG cluster with an application database and owner role (via bootstrap.initdb), continuous backups to object storage, and the cloud backup storage + identity primitives.

Request it

Add this to your PlatformApplication's spec.resourceRequirements (optional parameters are in the table below):

resourceRequirements:
- resourceType: postgresql
resourceName: my-postgresql # your handle — drives the env-var prefix + secret name
parameters:
dbName: <value>

Parameters

NameTypeRequiredDefaultDescription
dbNamestringyesName of the application database to create on the dedicated cluster.
ownerstringnoOwner role (application user) for the database. Defaults to dbName.
instancesstringno3Number of Postgres instances (1 primary + replicas).
storageSizestringno20GiPersistent volume size per instance (e.g. 20Gi).
postgresVersionstringno16PostgreSQL major version (CNPG image tag).
backupRetentionstringno30dBackup retention policy (e.g. 30d).
provisionStoragestringnotrueProvision the backup bucket + identity and enable managed backups: 'true' or 'false'. When 'false', the cluster is created without backups.

Connection

On grant, a connection secret is published with these tokens and injected into your workload as {RESOURCENAME}_{TOKEN} (UPPER_SNAKE) — e.g. resourceName: my-dbMY_DB_URL, MY_DB_USERNAME, …:

  • host
  • port
  • username
  • password
  • dbname

Status

FieldDescription
clusterNameName of the CNPG cluster.
databaseNameName of the application database.

Auto-generated from the PostgresCluster XRD + postgresql-cnpg ResourceCapability. Do not edit by hand.