Skip to content

Commit 892bad8

Browse files
androndoclaude
andcommitted
fix(keycloak): use barman-capable system image when backups enabled
The Keycloak DB backup (#3174) uses the in-tree native `barmanObjectStore`, whose `barman-cloud-*` binaries ship ONLY in the CNPG `system` image variant. Since #2342 the DB is pinned to the `standard` variant, which omits them — so with backups enabled a base backup fails `barman-cloud-backup: executable file not found` and WAL archiving cannot run (also risks WAL accumulation). Pin the barman-capable `system` variant only when backups are enabled (backup.enabled + destinationPath); otherwise keep `standard`. Verified on a freedom-portal cluster: with `system-trixie` the CNPG Backup completes and WAL archiving works to S3; with `standard-trixie` it fails as above. TEMPORARY bridge: `system` is deprecated in CNPG 1.27 (removed in 1.29). Remove this once Postgres backups migrate to the Barman Cloud Plugin — see #3300. Refs #3300, #2342, #3174. Co-Authored-By: Claude Opus 4.8 <[email protected]>
1 parent 77389d6 commit 892bad8

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

  • packages/system/keycloak/templates

‎packages/system/keycloak/templates/db.yaml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@ spec:
66
instances: 2
77
{{- $existingCluster := lookup "postgresql.cnpg.io/v1" "Cluster" .Release.Namespace "keycloak-db" }}
88
{{- $image := dig "spec" "imageName" "ghcr.io/cloudnative-pg/postgresql:17.7-standard-trixie" $existingCluster }}
9-
imageName: {{ if regexMatch ":17\\." $image }}ghcr.io/cloudnative-pg/postgresql:17.7-standard-trixie{{ else if regexMatch ":[0-9]+\\.[0-9]+$" $image }}{{ printf "%s-standard-trixie" $image }}{{ else }}{{ $image }}{{ end }}
9+
{{- /*
10+
Backups use the in-tree (native) barmanObjectStore, whose barman-cloud-*
11+
binaries ship ONLY in the CNPG `system` image variant. The `standard`
12+
variant (default since #2342) omits them, so with `standard` a base backup
13+
fails `barman-cloud-backup: executable file not found` and WAL archiving
14+
cannot run. When backups are enabled, pin the barman-capable `system`
15+
variant; otherwise keep `standard`.
16+
TEMPORARY: `system` is deprecated in CNPG 1.27 (removed in 1.29). Remove this
17+
once Postgres backups move to the Barman Cloud Plugin — see #3300.
18+
*/}}
19+
{{- $backupOn := and .Values.backup.enabled (not (empty .Values.backup.destinationPath)) }}
20+
{{- $variant := ternary "system" "standard" $backupOn }}
21+
imageName: {{ if regexMatch ":17\\." $image }}ghcr.io/cloudnative-pg/postgresql:17.7-{{ $variant }}-trixie{{ else if regexMatch ":[0-9]+\\.[0-9]+$" $image }}{{ printf "%s-%s-trixie" $image $variant }}{{ else }}{{ $image }}{{ end }}
1022
storage:
1123
size: 20Gi
1224
{{- if .Values._cluster.scheduling }}

0 commit comments

Comments
 (0)