Cnpg
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.
| Argument | Type | Description |
|---|---|---|
| namespace? | string | The namespace to list instead of the definition's. Left out or empty: the definition's namespace, and every namespace when that is empty too. |
| Argument | Type | Description |
|---|---|---|
| name | string | Cluster name. |
| namespace? | string | Namespace of the Cluster. Left out or empty: the definition's namespace. |
Resources
| Argument | Type | Description |
|---|---|---|
| namespace? | string | The namespace to list instead of the definition's. Left out or empty: the definition's namespace, and every namespace when that is empty too. |
| Argument | Type | Description |
|---|---|---|
| name | string | ScheduledBackup name. |
| namespace? | string | Namespace of the ScheduledBackup. Left out or empty: the definition's namespace. |
Resources
| Argument | Type | Description |
|---|---|---|
| namespace? | string | The 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? | string | Only the Backups of this Cluster. No inventory is recorded then: the inventory says what a whole list saw. |
| Argument | Type | Description |
|---|---|---|
| name | string | Backup name. |
| namespace? | string | Namespace of the Backup. Left out or empty: the definition's namespace. |
| Argument | Type | Description |
|---|---|---|
| name | string | Name of the Backup object. Running create again with the same name and request changes nothing. |
| namespace? | string | Namespace of the Cluster and the Backup. Left out or empty: the definition's namespace. |
| cluster | string | The Cluster to back up. |
| method? | enum | |
| target? | enum | Where the backup runs. Unset means the Cluster's own default. |
| online? | boolean | Take the backup online (volumeSnapshot). Unset means the Cluster's default. |
| onlineConfiguration? | object | |
| pluginConfiguration? | object | |
| waitSeconds? | number | How 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? | number | How long to wait between two reads of the Backup. |
Resources
- 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