Generators / cloudnative-pg
cloudnative-pg
1.1.2Renders CloudNativePG Clusters, Databases, Poolers, ScheduledBackups and Backups and Barman Cloud Plugin ObjectStores from inventory parameters.
Request a feature Report a problem
Badge
Show the latest listed version in your README. shields.io draws the badge from this page's badge.json, which every catalog build updates; once no version is listed, it reads "not listed".
[](https://kadet-hub.org/generators/cloudnative-pg/)
- Latest
- 1.1.2 路
- License
- Apache-2.0
- Owners
- Moep90
- Source
- github.com/kadet-hub/generators 路 0 repo stars, shared by 38 generators
- Thumbs up
- 馃憤 0 on GitHub Discussions
- Popularity
- 32 路 68200 pulls
- Image security
- Version 1.1.2 names no image.
cloudnative-pg Generator
Published on kadet-hub: pin a released version by digest from its catalog page.
Kapitan kadet generator for CloudNativePG PostgreSQL clusters. Built for CloudNativePG 1.30.1 and the Barman Cloud Plugin 0.15.1. It renders Cluster, Database, Pooler, ScheduledBackup and Backup (postgresql.cnpg.io/v1) and the plugin’s ObjectStore (barmancloud.cnpg.io/v1). PodMonitors come from the prometheus-operator generator, see Monitoring. Backups go through the Barman Cloud Plugin, which replaces the in-tree barmanObjectStore deprecated since CloudNativePG 1.26. The operator, the plugin and the Secrets with object store credentials are installed separately.
Usage
Kapitan Configuration
parameters:
kapitan:
dependencies:
- type: oci
source: ghcr.io/kadet-hub/cloudnative-pg@sha256:<digest>
output_path: lib/cloudnative-pg
compile:
- output_path: manifests/cloudnative-pg/
input_type: kadet
output_type: yml
input_paths:
- lib/cloudnative-pgExample
parameters:
generators:
cloudnative-pg:
namespace: databases
object_stores:
app-db-store:
configuration:
destinationPath: s3://pg-backups/app-db
endpointURL: https://s3.example.com
s3Credentials:
accessKeyId:
name: app-db-s3
key: ACCESS_KEY_ID
secretAccessKey:
name: app-db-s3
key: ACCESS_SECRET_KEY
wal:
compression: gzip
retention_policy: 30d
clusters:
app-db:
image_name: ghcr.io/cloudnative-pg/postgresql:18.6-system-trixie
storage: 50Gi
backup:
object_store: app-db-store
databases:
app:
cluster: app-db
owner: app
poolers:
app-db-pooler-rw:
cluster: app-db
pool_mode: transaction
scheduled_backups:
app-db-daily:
cluster: app-db
schedule: 0 3 * * *This yields a three-instance Cluster that archives WAL to app-db-store, the app database, a PgBouncer pooler in transaction mode on the -rw service, and a daily plugin backup at 03:00:00.
Inventory Contract
All keys live under parameters.generators.cloudnative-pg. Each entry becomes one resource named after its key, or after its name if it sets one. A reference such as cluster: <name> names the resource. Two entries of a section with the same name in one namespace fail the compile. The namespace resolves from the entry’s namespace, then parameters.generators.cloudnative-pg.namespace, then parameters.namespace, then default.
| Key | Kind |
|---|---|
clusters.<name> |
Cluster |
databases.<name> |
Database |
poolers.<name> |
Pooler |
scheduled_backups.<name> |
ScheduledBackup |
backups.<name> |
Backup |
object_stores.<name> |
ObjectStore |
Every entry accepts labels, annotations and spec, the raw CRD spec for fields without a flat key. Precedence is generator defaults, then spec, then flat keys and shorthands; a flat key replaces the whole spec field of the same name and logs a warning.
Flat keys are the snake_case spelling of top-level CRD spec fields; their values pass through unchanged, in CRD camelCase:
| Kind | Flat keys |
|---|---|
| Cluster | instances, image_name, image_catalog_ref, storage, wal_storage, postgresql, bootstrap, resources, affinity, monitoring, managed, plugins, replica, external_clusters, certificates |
| Database | cluster, database_name (spec.name), owner, ensure, database_reclaim_policy, encoding, locale, template, extensions, schemas |
| Pooler | cluster, instances, type, pgbouncer, template, service_template |
| ScheduledBackup | cluster, schedule, method, plugin_configuration, target, online, immediate, suspend, backup_owner_reference |
| Backup | cluster, method, plugin_configuration, target, online |
| ObjectStore | configuration, retention_policy, instance_sidecar_configuration |
Shorthands:
| Input | Result |
|---|---|
cluster: <name> |
cluster: {name: <name>} |
Cluster storage: <size>, wal_storage: <size> |
storage: {size: <size>}, walStorage: {size: <size>} |
Cluster backup: {object_store: <store>, server_name: <name>} |
a plugins entry barman-cloud.cloudnative-pg.io with isWALArchiver: true and the parameters barmanObjectName and, if set, serverName, as in the plugin’s usage guide; other plugins stay |
Pooler pool_mode: <mode> |
pgbouncer.poolMode: <mode> |
ScheduledBackup five-field schedule |
a leading 0 seconds field; CloudNativePG uses a six-field cron (backup.md) |
When a major PostgreSQL upgrade changes image_name, change backup.server_name with it, so the new major version archives to a new path (postgres_upgrades.md).
Defaults
The generator fills these only where the inventory leaves them unset:
| Kind | Default | Why |
|---|---|---|
| Cluster | instances: 3 |
A primary and two standbys, as in cluster-example.yaml; the CRD default of 1 has no failover. |
| Database | name: <entry key> |
spec.name, the PostgreSQL database name, is required by the CRD. |
| Pooler | pgbouncer: {} |
Required by the CRD, which defaults poolMode to session (connection_pooling.md). |
| ScheduledBackup, Backup | method: plugin, pluginConfiguration: {name: barman-cloud.cloudnative-pg.io} |
The CRD default barmanObjectStore is deprecated since 1.26 (backup.md); pluginConfiguration is set only for method: plugin. |
| ScheduledBackup | backupOwnerReference: self |
The Backups it creates are deleted with it; the CRD default none is the legacy behaviour (backup.md). |
A Cluster without storage size or a pvcTemplate storage request fails the compile, since the operator’s admission rejects it. A backup without object_store fails, and so does an ObjectStore with configuration.serverName, which the plugin requires empty (parameters.md). A Pooler named like its Cluster or the Cluster’s -rw, -ro or -r Service fails, since the Pooler’s Service of the same name would patch the Cluster’s; name it like the upstream pooler-example-rw. A Cluster whose backup.object_store is an ObjectStore of this inventory in another namespace fails, since the plugin reads it from the Cluster’s namespace. A Backup or ScheduledBackup using the Barman Cloud Plugin for a Cluster of this inventory without the plugin fails, and so does backup together with spec.backup.barmanObjectStore, which the webhook rejects. The in-tree barmanObjectStore, removed in CloudNativePG 1.31.0 (release notes), and monitoring.enablePodMonitor still pass through, with a warning. Database owner, ObjectStore configuration.destinationPath and ScheduledBackup schedule have no default and fail schema validation when missing.
Pooler instances stays at the CRD default of 1. Nothing grants access or exposure by default: enableSuperuserAccess stays at the CRD default false, the Cluster and Pooler Services stay ClusterIP, and a LoadBalancer or extra service is set through managed.services or service_template. Without image_name the operator picks its default image, ghcr.io/cloudnative-pg/postgresql:18.6-system-trixie at 1.30.1, and an operator upgrade can change it. ObjectStore retention_policy has no default, so backups are kept until you set one. A Backup is an immutable one-shot request; keep it in the inventory only until it has run.
Monitoring
CloudNativePG 1.30 deprecates monitoring.enablePodMonitor in favour of a PodMonitor you own (monitoring.md). Render it with the prometheus-operator generator in the Cluster’s namespace; it must select cnpg.io/cluster: <name> and scrape port metrics. For app-db:
parameters:
generators:
prometheus_operator:
pod_monitors:
app-db:
namespace: databases
selector:
cnpg.io/cluster: app-db
pod_metrics_endpoints:
- metricsWith monitoring.tls.enabled: true on the Cluster, the endpoint scrapes over HTTPS with the cluster CA (app-db-ca, or the Secret in certificates.serverCASecret) and the server name app-db-rw:
parameters:
generators:
prometheus_operator:
pod_monitors:
app-db:
namespace: databases
selector:
cnpg.io/cluster: app-db
pod_metrics_endpoints:
- port: metrics
scheme: https
tlsConfig:
ca:
secret:
name: app-db-ca
key: ca.crt
serverName: app-db-rwOutput Files
| Output key | Kind |
|---|---|
<namespace>/<name>-cluster |
postgresql.cnpg.io/v1 Cluster |
<namespace>/<name>-database |
postgresql.cnpg.io/v1 Database |
<namespace>/<name>-pooler |
postgresql.cnpg.io/v1 Pooler |
<namespace>/<name>-scheduledbackup |
postgresql.cnpg.io/v1 ScheduledBackup |
<namespace>/<name>-backup |
postgresql.cnpg.io/v1 Backup |
<namespace>/<name>-objectstore |
barmancloud.cnpg.io/v1 ObjectStore |
v1 is the only served version and the storage version of every kind at CloudNativePG 1.30.1 and the Barman Cloud Plugin 0.15.1; none is deprecated. The compiled output is validated against the upstream CRD schemas in schemas/.
Used in stacks
Guides
Versions
Add a version's inventory entry, then compile with the consumer workflow, which verifies the artifact and runs Kapitan in the sandbox.
Free of charge, as is and on a best-effort basis: use at your own risk, and review the compiled output before you apply it. Terms
This catalog was built from index serial 148. Set index_serial: 148 in .kapitan-sandbox.yaml and the consumer workflow refuses any older index, so a rolled-back index cannot bring back a yanked version.
Checks find known patterns; they do not prove a generator safe. What a listing covers
| Version | Built for (schema-checked) |
|---|---|
| 1.1.2 | Barman Cloud Plugin 0.15.1 CloudNativePG 1.30.1 |
| 1.1.1 | Barman Cloud Plugin 0.15.1 CloudNativePG 1.30.1 |
| 1.1.0 | Barman Cloud Plugin 0.15.1 CloudNativePG 1.30.1 |
| 1.0.1 | Barman Cloud Plugin 0.15.1 CloudNativePG 1.30.1 |
| 1.0.0 | Barman Cloud Plugin 0.15.1 CloudNativePG 1.30.1 |
1.1.2#
1Inventory Your project
Inventory entry
parameters:
kapitan:
dependencies:
- type: oci
source: ghcr.io/kadet-hub/cloudnative-pg:1.1.2@sha256:b17a561ad5867309ff024691e9427375202801588d546da1d6a6cc48e0cc1444
output_path: lib/cloudnative-pg
2Verify kadet-hub
Terminal
gh attestation verify \
oci://ghcr.io/kadet-hub/cloudnative-pg@sha256:b17a561ad5867309ff024691e9427375202801588d546da1d6a6cc48e0cc1444 \
--owner kadet-hub \
--cert-identity https://github.com/kadet-hub/registry/.github/workflows/release.yml@refs/heads/main
Transparency log: Rekor entry 3692517505, in Sigstore's public, append-only log, so the attestation stays checkable independent of this site.
3Checks kadet-hub
Checked by the release run on , gate at a82f7e26a49f.
- Secrets gitleaks 8.30.1
No secret matched the marketplace's gitleaks rules. - Malware ClamAV 1.5.4
No file matched a ClamAV signature. - Malicious package heuristics GuardDog 3.2.0
No GuardDog threat rule matched. - Dangerous code Semgrep 1.180.0
No marketplace Semgrep rule matched, such as eval, subprocess or network calls. - Python errors Ruff 0.17.0
No syntax error or undefined name (Ruff, error rules only). - File tree tree_check.py
No symlink, executable or banned file; imports within the allowlist. - Sandboxed compile gVisor 20261005, Kapitan 0.36.3
The fixture compiled without network, with decoy credentials; no undeclared program ran, no decoy was read. - Output capabilities Conftest v0.71.1
The compiled output uses only the capabilities the manifest declares. - CI detection Kapitan 0.36.3
The output is the same with CI variables set.
Record
- Kapitan declared
- >=0.36.3,<0.37
- Kapitan checked
- 0.36.3
- Backends checked
- reclass-rs, omegaconf
- With --cache
- passed
- krab
- compatible
- Built for (schema-checked)
- Barman Cloud Plugin 0.15.1
CloudNativePG 1.30.1 - Source
- cloudnative-pg-v1.1.2 路 cloudnative-pg
- Source commit
d2acfd07c1d3a811f012ed0d4046cb2efa8c051c- Binaries
- none
- Output capabilities
- none
- Digest
sha256:b17a561ad5867309ff024691e9427375202801588d546da1d6a6cc48e0cc1444
Output diff
Fixture output against 1.1.1: 0 files, 0 hunks.
1.1.1#
1Inventory Your project
Inventory entry
parameters:
kapitan:
dependencies:
- type: oci
source: ghcr.io/kadet-hub/cloudnative-pg:1.1.1@sha256:5881e6c467ab214158b816a1e5f582be1cb9a5c048c216f9c01111551cc048dc
output_path: lib/cloudnative-pg
2Verify kadet-hub
Terminal
gh attestation verify \
oci://ghcr.io/kadet-hub/cloudnative-pg@sha256:5881e6c467ab214158b816a1e5f582be1cb9a5c048c216f9c01111551cc048dc \
--owner kadet-hub \
--cert-identity https://github.com/kadet-hub/registry/.github/workflows/release.yml@refs/heads/main
Transparency log: Rekor entry 3469758211, in Sigstore's public, append-only log, so the attestation stays checkable independent of this site.
3Checks kadet-hub
Checked by the release run on , gate at 7efd88092d5e.
- Secrets gitleaks 8.30.1
No secret matched the marketplace's gitleaks rules. - Malware ClamAV 1.5.4
No file matched a ClamAV signature. - Malicious package heuristics GuardDog 3.2.0
No GuardDog threat rule matched. - Dangerous code Semgrep 1.180.0
No marketplace Semgrep rule matched, such as eval, subprocess or network calls. - Python errors Ruff 0.17.0
No syntax error or undefined name (Ruff, error rules only). - File tree tree_check.py
No symlink, executable or banned file; imports within the allowlist. - Sandboxed compile gVisor 20261005, Kapitan 0.36.3
The fixture compiled without network, with decoy credentials; no undeclared program ran, no decoy was read. - Output capabilities Conftest v0.71.1
The compiled output uses only the capabilities the manifest declares. - CI detection Kapitan 0.36.3
The output is the same with CI variables set.
Record
- Kapitan declared
- >=0.36.3,<0.37
- Kapitan checked
- 0.36.3
- Backends checked
- reclass-rs, omegaconf
- With --cache
- passed
- krab
- compatible
- Built for (schema-checked)
- Barman Cloud Plugin 0.15.1
CloudNativePG 1.30.1 - Source
- cloudnative-pg-v1.1.1 路 cloudnative-pg
- Source commit
5e4335d164d811f9f896063c948cae3e5712ab5c- Binaries
- none
- Output capabilities
- none
- Digest
sha256:5881e6c467ab214158b816a1e5f582be1cb9a5c048c216f9c01111551cc048dc
Output diff
Fixture output against 1.1.0: 0 files, 0 hunks.
1.1.0#
1Inventory Your project
Inventory entry
parameters:
kapitan:
dependencies:
- type: oci
source: ghcr.io/kadet-hub/cloudnative-pg:1.1.0@sha256:99320e83917d99190c45efa8f8e1dc4e732c65619ebf9c70151a0d96b4f5dca9
output_path: lib/cloudnative-pg
2Verify kadet-hub
Terminal
gh attestation verify \
oci://ghcr.io/kadet-hub/cloudnative-pg@sha256:99320e83917d99190c45efa8f8e1dc4e732c65619ebf9c70151a0d96b4f5dca9 \
--owner kadet-hub \
--cert-identity https://github.com/kadet-hub/registry/.github/workflows/release.yml@refs/heads/main
Transparency log: Rekor entry 3458633997, in Sigstore's public, append-only log, so the attestation stays checkable independent of this site.
3Checks kadet-hub
Checked by the release run on , gate at 43055771b1f8.
- Secrets gitleaks 8.30.1
No secret matched the marketplace's gitleaks rules. - Malware ClamAV 1.5.4
No file matched a ClamAV signature. - Malicious package heuristics GuardDog 3.2.0
No GuardDog threat rule matched. - Dangerous code Semgrep 1.180.0
No marketplace Semgrep rule matched, such as eval, subprocess or network calls. - Python errors Ruff 0.17.0
No syntax error or undefined name (Ruff, error rules only). - File tree tree_check.py
No symlink, executable or banned file; imports within the allowlist. - Sandboxed compile gVisor 20261005, Kapitan 0.36.3
The fixture compiled without network, with decoy credentials; no undeclared program ran, no decoy was read. - Output capabilities Conftest v0.71.1
The compiled output uses only the capabilities the manifest declares. - CI detection Kapitan 0.36.3
The output is the same with CI variables set.
Record
- Kapitan declared
- >=0.36.3,<0.37
- Kapitan checked
- 0.36.3
- Backends checked
- reclass-rs, omegaconf
- With --cache
- passed
- krab
- compatible
- Built for (schema-checked)
- Barman Cloud Plugin 0.15.1
CloudNativePG 1.30.1 - Source
- cloudnative-pg-v1.1.0 路 cloudnative-pg
- Source commit
5d11df444024d1f2598b3cad1d6f5553195fd4a3- Binaries
- none
- Output capabilities
- none
- Digest
sha256:99320e83917d99190c45efa8f8e1dc4e732c65619ebf9c70151a0d96b4f5dca9
Output diff
Fixture output against 1.0.1: 0 files, 0 hunks.
1.0.1#
1Inventory Your project
Inventory entry
parameters:
kapitan:
dependencies:
- type: oci
source: ghcr.io/kadet-hub/cloudnative-pg:1.0.1@sha256:281417a421b0053070fbdc552f9032a3f8d564c0ca2047ec500842a0d060a8f7
output_path: lib/cloudnative-pg
2Verify kadet-hub
Terminal
gh attestation verify \
oci://ghcr.io/kadet-hub/cloudnative-pg@sha256:281417a421b0053070fbdc552f9032a3f8d564c0ca2047ec500842a0d060a8f7 \
--owner kadet-hub \
--cert-identity https://github.com/kadet-hub/registry/.github/workflows/release.yml@refs/heads/main
Transparency log: Rekor entry 3249981079, in Sigstore's public, append-only log, so the attestation stays checkable independent of this site.
3Checks kadet-hub
Checked by the release run on , gate at 6f0242aa6a3c.
- Secrets gitleaks 8.30.1
No secret matched the marketplace's gitleaks rules. - Malware ClamAV 1.5.4
No file matched a ClamAV signature. - Malicious package heuristics GuardDog 3.2.0
No GuardDog threat rule matched. - Dangerous code Semgrep 1.180.0
No marketplace Semgrep rule matched, such as eval, subprocess or network calls. - Python errors Ruff 0.17.0
No syntax error or undefined name (Ruff, error rules only). - File tree tree_check.py
No symlink, executable or banned file; imports within the allowlist. - Sandboxed compile gVisor 20261005, Kapitan 0.36.3
The fixture compiled without network, with decoy credentials; no undeclared program ran, no decoy was read. - Output capabilities Conftest 0.71.1
The compiled output uses only the capabilities the manifest declares. - CI detection Kapitan 0.36.3
The output is the same with CI variables set.
Record
- Kapitan declared
- >=0.36.3,<0.37
- Kapitan checked
- 0.36.3
- Backends checked
- not recorded
- With --cache
- not recorded
- krab
- compatible
- Built for (schema-checked)
- Barman Cloud Plugin 0.15.1
CloudNativePG 1.30.1 - Source
- cloudnative-pg-v1.0.1 路 cloudnative-pg
- Source commit
e4891e8fd85ca0a19ebf361e8b54fd6473fd8a2f- Binaries
- none
- Output capabilities
- none
- Digest
sha256:281417a421b0053070fbdc552f9032a3f8d564c0ca2047ec500842a0d060a8f7
Output diff
No output diff recorded: this version was published before the release run recorded one.
1.0.0#
1Inventory Your project
Inventory entry
parameters:
kapitan:
dependencies:
- type: oci
source: ghcr.io/kadet-hub/cloudnative-pg:1.0.0@sha256:e9c500eca116f100abc1646daff1fa187e3d2561be32116be209cfc4a0521d86
output_path: lib/cloudnative-pg
2Verify kadet-hub
Terminal
gh attestation verify \
oci://ghcr.io/kadet-hub/cloudnative-pg@sha256:e9c500eca116f100abc1646daff1fa187e3d2561be32116be209cfc4a0521d86 \
--owner kadet-hub \
--cert-identity https://github.com/kadet-hub/registry/.github/workflows/release.yml@refs/heads/main
Transparency log: Rekor entry 3241129547, in Sigstore's public, append-only log, so the attestation stays checkable independent of this site.
3Checks kadet-hub
Checked by the release run on , gate at 461ba3b3c507.
- Secrets gitleaks 8.30.1
No secret matched the marketplace's gitleaks rules. - Malware ClamAV 1.5.4
No file matched a ClamAV signature. - Malicious package heuristics GuardDog 3.2.0
No GuardDog threat rule matched. - Dangerous code Semgrep 1.180.0
No marketplace Semgrep rule matched, such as eval, subprocess or network calls. - Python errors Ruff 0.17.0
No syntax error or undefined name (Ruff, error rules only). - File tree tree_check.py
No symlink, executable or banned file; imports within the allowlist. - Sandboxed compile gVisor 20261005, Kapitan 0.36.3
The fixture compiled without network, with decoy credentials; no undeclared program ran, no decoy was read. - Output capabilities Conftest 0.71.1
The compiled output uses only the capabilities the manifest declares. - CI detection Kapitan 0.36.3
The output is the same with CI variables set.
Record
- Kapitan declared
- >=0.36.3,<0.37
- Kapitan checked
- 0.36.3
- Backends checked
- not recorded
- With --cache
- not recorded
- krab
- compatible
- Built for (schema-checked)
- Barman Cloud Plugin 0.15.1
CloudNativePG 1.30.1 - Source
- cloudnative-pg-v1.0.0 路 cloudnative-pg
- Source commit
572dda58b592673020f4a8d97142d1cdd2125440- Binaries
- none
- Output capabilities
- none
- Digest
sha256:e9c500eca116f100abc1646daff1fa187e3d2561be32116be209cfc4a0521d86
Output diff
No output diff recorded: this version was published before the release run recorded one.