Skip to content

feat(chart): CNPG zone affinity, synchronous API and barman-cloud plugin backup (v0.7.27) - #473

Merged
bl0rb merged 3 commits into
mainfrom
claude/wonderful-faraday-xy3vbz
Nov 18, 2026
Merged

bl0rb merged 3 commits into
mainfrom
claude/wonderful-faraday-xy3vbz

Conversation

@bl0rb

@bl0rb bl0rb commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the request "CNPG-Cluster im Weave-Chart – Hochverfügbarkeit über Zonen und Backup per Barman-Cloud-Plugin" for deploy/charts/weave (postgresql.mode: cnpg):

  • R1/R2/R3: postgresql.cnpg.affinity, topologySpreadConstraints, primaryUpdateMethod and synchronous (new CNPG API under spec.postgresql) are passed through. Empty values are not rendered.
  • R4: postgresql.cnpg.barmanCloudPlugin renders an ObjectStore (barmancloud.cnpg.io/v1), the spec.plugins entry (enabled = archiving, isWALArchiver: true) and a ScheduledBackup (method: plugin). If kmsKeyId is set, --sse-kms-key-id=<id> is appended to wal.archiveAdditionalCommandArgs and data.additionalCommandArgs. When the block is off, barmancloud.cnpg.io does not appear anywhere.
  • Decision: while archiving: false (stage 1), no ScheduledBackup is rendered.
  • Checks (_helpers.tpl, readable fail):
    • synchronous together with minSyncReplicas/maxSyncReplicas > 0
    • synchronous.number >= instances + len(standbyNamesPre/Post), the same rule as the CNPG 1.30 webhook
    • the plugin together with the built-in backup
    • empty destinationPath
    • no IAM role and no secret
    • kmsKeyId without encryption: aws:kms
  • R5: values.yaml documents the deprecation of the built-in backup (removed in CNPG 1.31) and the zone guarantee only with topology.kubernetes.io/zone + required. It also notes: no more instances than zones, StorageClass with WaitForFirstConsumer, synchronous preferred over min/max, and a rolling restart when archiving changes.
  • A5: new scripts/check_chart_cnpg.sh (lint, rendering of the operator example examples/cnpg-ha-barman-cloud.yaml in both stages with structure checks, 6 failure cases). It runs in the "Platform configuration" job of pr-ci.yml. Before this change, no PR test rendered deploy/charts/weave.
  • A6: CHANGELOG entry including upgrade notes (rolling restart on archiving false→true or on an affinity change).
  • Release commit v0.7.27 (README, CHANGELOG).

Affected services

deploy/charts/weave, scripts/, .github/workflows/pr-ci.yml, services/ingest/CHANGELOG.md, README.md

Test plan

  • A1: helm template rendering is byte-identical to before for three cases: defaults, cnpg with minimal values, and cnpg with backup.enabled: true plus min/maxSyncReplicas: 1. Compared locally against the base commit. Helm 3.16.2 was used here and in CI.
  • scripts/check_chart_cnpg.sh passes. It covers lint, both stages of the example, plugin off, and the 6 failure cases. A mutation test (plugin enabled hard-coded to false) is detected.
  • pytest -q scripts/tests: 70 passed, 9 skipped
  • Field names checked against the sources of CloudNativePG v1.30.0 (cluster_types.go, cluster_webhook.go) and plugin-barman-cloud v0.13.0 (objectstore_types.go)
  • Not tested on a real cluster (operator plus plugin, IRSA, SSE-KMS)
  • Not checked whether the plugin's argument validation accepts --sse-kms-key-id. The platform team uses the same pattern on the same EKS cluster.

Checklist

  • Tests added or updated for the changed behaviour
  • contracts/ updated if an API or event changed: n/a
  • python scripts/weave_config.py check passes if configuration changed: n/a, weave.yaml unchanged
  • Docs updated where operators see the change (values.yaml, CHANGELOG)
  • No secrets, real customer data, or generated deploy/.env in the diff (bucket, role and KMS key in the example are placeholders)

Notes for reviewers

  • The check against plugin plus built-in backup also fires when archiving: false, as the request requires. The CNPG webhook itself would accept that stage, and the error message says so.
  • Helm creates unknown kinds in alphabetical order on install, so Cluster comes before ObjectStore. With Argo CD, the order can be set via barmanCloudPlugin.objectStoreAnnotations (sync wave).
  • The tag v0.7.27 follows after the merge, on the merge commit, as with v0.7.26.

Generated by Claude Code

…gin backup

- postgresql.cnpg.affinity, topologySpreadConstraints, primaryUpdateMethod
  and synchronous are passed through to the CNPG Cluster.
- barmanCloudPlugin renders an ObjectStore, the spec.plugins entry and a
  ScheduledBackup (method: plugin); SSE-KMS via kmsKeyId. No ScheduledBackup
  while archiving=false.
- Chart-side checks mirror the CNPG webhook (legacy vs. new sync API,
  synchronous.number, plugin vs. built-in backup) plus destinationPath,
  credentials and kmsKeyId/encryption.
- Built-in backup marked deprecated (removed in CloudNativePG 1.31).
- Defaults render byte-identical to before.
- PR CI lints and renders deploy/charts/weave (scripts/check_chart_cnpg.sh).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W9t7FeuDDnBkiM8kKa8MN9
- Plugin-plus-built-in-backup message no longer claims the webhook rejects
  the archiving=false stage.
- Render test checks nesting of synchronous, affinity, primaryUpdateMethod
  and the plugins entry (enabled follows archiving) via PyYAML.
- CHANGELOG states the synchronous.number rule as the webhook applies it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W9t7FeuDDnBkiM8kKa8MN9
@bl0rb
bl0rb merged commit 1c52fe2 into main Nov 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants