db(portal): migrate WAL archiving to the CNPG-I Barman Cloud plugin
CloudNativePG 1.30 deprecates spec.backup.barmanObjectStore and 1.31 removes
it, so the pin on 1.30.0 was a hard gate. This closes that gate:
- Vendors plugin-barman-cloud v0.16.0 verbatim into
infrastructure/databases/base/upstream/ (the operator manifest's pattern),
with a kustomize patch only for --log-level=info and resource bounds.
v0.16.0 requires CNPG >= 1.30 and is registered through Service
annotations; its operator<->plugin mTLS pair comes from cert-manager
(previous commit).
- Adds ObjectStore sirius-growth/portal-wal: the literal translation of the
retired barmanObjectStore block, with retentionPolicy 14d moved off the
Cluster (in the plugin, retention belongs to the store).
- Cluster portal drops spec.backup entirely and gains spec.plugins
(barman-cloud.cloudnative-pg.io, isWALArchiver, barmanObjectName
portal-wal, serverName portal). The server name is the barman prefix, so
the plugin keeps writing s3://pg-wal-archive/portal/{base,wals}/... — the
same objects the in-tree archiver left behind; the 14-day window stays
readable.
- ScheduledBackup portal-daily switches to method: plugin.
- databases waits on cert-manager; apps waits on databases (the ObjectStore
CRD ships with the plugin).
- CNPG dashboard: the backup timestamp metric family changes name under the
plugin, so the panel now accepts both.
This commit is contained in:
parent
f3a8233e37
commit
c45255242b
11 changed files with 1312 additions and 51 deletions
|
|
@ -423,7 +423,7 @@ data:
|
|||
"id": 29,
|
||||
"type": "stat",
|
||||
"title": "Last available backup",
|
||||
"description": "0 = never. There are NO Backup/Cluster backup resources in this cluster (verified: `kubectl get backups.postgresql.cnpg.io -A` is empty), so a 0 here is the honest answer, not a broken panel.",
|
||||
"description": "0 = never. sirius-growth/portal archives through the CNPG-I Barman Cloud plugin, which exposes its own metric family `barman_cloud_cloudnative_pg_io_*`; the in-tree `cnpg_collector_*` name is kept in the `or` for any cluster still on the deprecated path. A 0 means neither series exists.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
|
|
@ -440,7 +440,7 @@ data:
|
|||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "max by (namespace) (cnpg_collector_last_available_backup_timestamp{namespace=~\"$namespace\"})",
|
||||
"expr": "max by (namespace) (cnpg_collector_last_available_backup_timestamp{namespace=~\"$namespace\"} or barman_cloud_cloudnative_pg_io_last_available_backup_timestamp{namespace=~\"$namespace\"})",
|
||||
"refId": "A",
|
||||
"editorMode": "code",
|
||||
"range": true,
|
||||
|
|
@ -937,7 +937,7 @@ data:
|
|||
"id": 40,
|
||||
"type": "timeseries",
|
||||
"title": "WAL generation",
|
||||
"description": "Bytes of WAL written per second. On a cluster with no backups, WAL has nothing archiving it away.",
|
||||
"description": "Bytes of WAL written per second. sirius-growth/portal archives its WAL to the Linode Garage; forgejo/pg does not archive, so its WAL only ever fills the pg_wal directory.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
|
|
@ -994,7 +994,7 @@ data:
|
|||
"id": 41,
|
||||
"type": "timeseries",
|
||||
"title": "WAL archiver failures",
|
||||
"description": "pg_stat_archiver.failed_count. Archiving is not configured on either cluster (no ObjectStore/backup), so treat non-zero here as 'something was attempted and failed'.",
|
||||
"description": "pg_stat_archiver.failed_count. Archiving is configured only on sirius-growth/portal (Barman Cloud plugin -> Linode Garage); forgejo/pg has no archiver, so any non-zero value is the honest signal that WAL failed to reach the archive.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
|
|
@ -1203,7 +1203,7 @@ data:
|
|||
"showLineNumbers": false,
|
||||
"showMiniMap": false
|
||||
},
|
||||
"content": "- **No backups exist.** `kubectl get backups.postgresql.cnpg.io -A` returns nothing; neither Cluster\n declares `spec.backup`. The \"Last available backup\" stat therefore reads 0 (never) \u2014 that is the\n real state, not a missing metric.\n- **Single instance.** Both clusters run `instances: 1`, so replication lag / streaming replicas /\n in recovery are structurally zero. The panels show the zero and say so instead of hiding them.\n- **Query age vs transaction age.** CNPG's default query set exposes\n `cnpg_backends_max_tx_duration_seconds` (transaction age). Per-statement `query_start` age is not in\n the default set; adding it would need another custom query in the cluster's\n `customQueriesConfigMap`.\n- **Permissions.** Custom queries run as `cnpg_metrics_exporter`, not superuser. See\n docs/monitoring-dashboards.md for the GRANT the Forgejo Actions metrics need.\n"
|
||||
"content": "- **Backups exist on one cluster only.** `sirius-growth/portal` archives WAL + daily base backups\n through the CNPG-I Barman Cloud plugin (`ObjectStore portal-wal`) into the Linode Garage;\n `forgejo/pg` has no archiver by design. The \"Last available backup\" stat reads 0 only if neither\n the plugin's `barman_cloud_cloudnative_pg_io_last_available_backup_timestamp` nor the legacy\n `cnpg_collector_last_available_backup_timestamp` series exists.\n- **Single instance.** Both clusters run `instances: 1`, so replication lag / streaming replicas /\n in recovery are structurally zero. The panels show the zero and say so instead of hiding them.\n- **Query age vs transaction age.** CNPG's default query set exposes\n `cnpg_backends_max_tx_duration_seconds` (transaction age). Per-statement `query_start` age is not in\n the default set; adding it would need another custom query in the cluster's\n `customQueriesConfigMap`.\n- **Permissions.** Custom queries run as `cnpg_metrics_exporter`, not superuser. See\n docs/monitoring-dashboards.md for the GRANT the Forgejo Actions metrics need.\n"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue