Skip to main content

Cnpg

@dataverket/cnpgv2026.11.12.1· AGPL-3.0-only· 9d agoBEHAVIORSACCEPTED WARNINGS
01README

CloudNativePG for swamp: PostgreSQL Clusters, ScheduledBackups and Backups (postgresql.cnpg.io/v1) as three model types, read with plain kubectl, and an on-demand Backup you can wait for. No kubectl plugin is needed. cluster lists and reads Clusters: phase, instances wanted and ready, the current and the target primary, each instance's state and timeline, image and PostgreSQL version, storage, every condition, the recovery window, the backup configuration by reference, and a summary of four booleans to assert on: healthy, archiving, primaryChanging, instancesReady. The recovery window is read from the Cluster's status for the in-tree methods and from the Barman Cloud plugin's ObjectStore for the plugin, and the record says which. scheduledbackup lists and reads ScheduledBackups with the newest Backup each schedule made and its result, so "did last night's backup work" is one record. backup lists and reads Backups, with phase, times, WAL and LSN range, id, destination and error, and create makes an on-demand Backup with the barmanObjectStore, plugin or volumeSnapshot method: it first checks that the Cluster exists and is configured for the method, treats a Backup of the same name and request as already made, waits a bounded time, and records the Backup as it stands. Every list also writes an inventory record of what it saw, with one line for each Cluster that is not healthy, each failed Backup and each schedule that is suspended or failing. Every call to the cluster has a time limit, and the body of create ends within 170 seconds whatever the cluster does. A fenced or hibernated Cluster is recorded as such, and a Backup that does not end is named in the inventory once it is older than a limit you set. A Cluster that is failing over and a Backup that failed are records, not errors; a method fails only when the call could not be made. No credential is read or stored: no Secret name, no key, and no user or password inside a URL. Of a Cluster's plugin parameters only the names are stored, and the values of barmanObjectName and serverName, which say where backups go.

02Behaviors3
@dataverket/cnpg/clusterv2026.11.12.1cluster.ts
fn list(namespace?: string)
List CloudNativePG Clusters with phase, instances, primary, WAL archiving and backup state, and record an inventory of the list that names each Cluster that is not healthy and why
ArgumentTypeDescription
namespace?stringThe namespace to list instead of the definition's. Left out or empty: the definition's namespace, and every namespace when that is empty too.
fn get(name: string, namespace?: string)
Read one CloudNativePG Cluster: phase, instances, primary, WAL archiving and backup state
ArgumentTypeDescription
namestringCluster name.
namespace?stringNamespace of the Cluster. Left out or empty: the definition's namespace.

Resources

cluster(infinite)— CloudNativePG Cluster status: phase, instances, primary, image, storage, conditions, WAL archiving and backup state, backup configuration by reference, and a summary
@dataverket/cnpg/scheduledbackupv2026.11.12.1scheduledbackup.ts
fn list(namespace?: string)
List CloudNativePG ScheduledBackups, each with the newest Backup it made and its result, and record an inventory of the list that names each schedule that is suspended or failing and why
ArgumentTypeDescription
namespace?stringThe namespace to list instead of the definition's. Left out or empty: the definition's namespace, and every namespace when that is empty too.
fn get(name: string, namespace?: string)
Read one CloudNativePG ScheduledBackup and the newest Backup it made, with its result
ArgumentTypeDescription
namestringScheduledBackup name.
namespace?stringNamespace of the ScheduledBackup. Left out or empty: the definition's namespace.

Resources

scheduledbackup(infinite)— CloudNativePG ScheduledBackup: schedule, suspension, last and next schedule time, and the newest Backup it made with its result
@dataverket/cnpg/backupv2026.11.12.1backup.ts
fn list(namespace?: string, cluster?: string)
List CloudNativePG Backups with phase, method, times, WAL range and destination, and record an inventory of the list that names each Backup that failed, or has not ended for too long, and why
ArgumentTypeDescription
namespace?stringThe namespace to list instead of the definition's. Left out or empty: the definition's namespace, and every namespace when that is empty too.
cluster?stringOnly the Backups of this Cluster. No inventory is recorded then: the inventory says what a whole list saw.
fn get(name: string, namespace?: string)
Read one CloudNativePG Backup: phase, times, WAL range, destination and error
ArgumentTypeDescription
namestringBackup name.
namespace?stringNamespace of the Backup. Left out or empty: the definition's namespace.
fn create(name: string, namespace?: string, cluster: string, method?: enum, target?: enum, online?: boolean, onlineConfiguration?: object, pluginConfiguration?: object, waitSeconds?: number, pollSeconds?: number)
Create an on-demand Backup of a CloudNativePG Cluster after checking the Cluster is configured for the method; waits a bounded time and records the Backup as it stands. The method ends within 170 seconds. Run get for the result of a long backup
ArgumentTypeDescription
namestringName of the Backup object. Running create again with the same name and request changes nothing.
namespace?stringNamespace of the Cluster and the Backup. Left out or empty: the definition's namespace.
clusterstringThe Cluster to back up.
method?enum
target?enumWhere the backup runs. Unset means the Cluster's own default.
online?booleanTake the backup online (volumeSnapshot). Unset means the Cluster's default.
onlineConfiguration?object
pluginConfiguration?object
waitSeconds?numberHow long to wait for the Backup to end before recording it as it stands. The time the reads take counts, and the wait is cut short when the calls before it were slow: the method never runs longer than 170 seconds.
pollSeconds?numberHow long to wait between two reads of the Backup.

Resources

backup(infinite)— CloudNativePG Backup: phase, method, start and stop time, WAL and LSN range, id, destination, the instance it ran on and the error of a failed one
03Previous Versions1
2026.11.10.1AGPL-3.0-only
04Stats
A
100 / 100
Downloads
4
Archive size
100.6 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

06Platforms
07Labels