Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a1ec3db
fix: plugin-barman-cloud likeness and readiness probes (#776)
tuunit Jun 24, 2026
33c83fc
chore(deps): update actions/setup-python action to v6.3.0 (#927)
renovate[bot] Jun 25, 2026
cacd294
chore(deps): update azure/setup-helm action to v5.0.1 (#926)
renovate[bot] Jun 25, 2026
8dba148
Merge branch 'main' into feat/barman-plugin-support
itay-grudev Jun 25, 2026
7c902a3
fix: when is the main plugins section specified
itay-grudev Jun 25, 2026
11d2084
explicitly specifying backup pluginConfiguration
itay-grudev Jun 25, 2026
caf901d
fix: objectstore is now a helm hook to ensure it exists before the cl…
itay-grudev Jun 25, 2026
8acfd9e
recovery s3 creds not provided on recovery
itay-grudev Jun 25, 2026
4ad88a0
fix: backup import and pg_basebackup do not require s3 creds
itay-grudev Jun 25, 2026
fbbeeb4
debug logs on failure for plugin migration
itay-grudev Jun 25, 2026
97ae5d2
deleted backups during cleanup to speed up cleanup
itay-grudev Jun 25, 2026
d4e7a2c
fix: incorrect recovery-s3-creds condition
itay-grudev Jun 27, 2026
38d0e60
fix: typo in the external clusters section
itay-grudev Jun 28, 2026
30aa4e1
fix: test step order - no base backup
itay-grudev Jun 28, 2026
100915a
faster cleanup by removing backups
itay-grudev Jun 28, 2026
c901832
simpler upgrade procedure because the objectstore is a helm hook
itay-grudev Jun 28, 2026
3fed398
removed backup running assert as it is unreliable. keeping completed …
itay-grudev Jun 28, 2026
8777a91
fix: missing minio/mc image tag
itay-grudev Jun 28, 2026
1c7d456
fix: migration test timeout and improved debug logs
itay-grudev Jun 28, 2026
4d5b001
fixed hook annotations
itay-grudev Jun 29, 2026
61db9df
fix duplicated line
itay-grudev Jun 29, 2026
9e3207b
fix: ability to override the barman plugin configuration
itay-grudev Jun 29, 2026
5fbd4a2
ability to override enabled and isWALArchiver
itay-grudev Jun 29, 2026
aa5d601
test for plugin configuration passthrough
itay-grudev Jun 29, 2026
ac87e60
fix: plugin configuration passthrough
itay-grudev Jun 29, 2026
cbe7650
fix: updated objectstore condition based on the new configuration opt…
itay-grudev Jun 30, 2026
5d23570
added pre-rollback hooks to the objectstores
itay-grudev Jul 2, 2026
20e887c
added an additional upgrade assertion
itay-grudev Jul 2, 2026
f73ee7e
test(cluster): fix barman-plugin-migration test assertions
aqeelat Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-kind/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
steps:
- id: helm
name: Set up Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: v3.21.1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: v3.21.1

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: 3.14

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
echo "${{ secrets.PGP_KEY_PASSPHRASE }}" > /tmp/passphrase-file.txt

- name: Set up Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: v3.21.1

Expand Down
1 change: 1 addition & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Kubernetes: `>=1.29.0-0`
| backups.google.path | string | `"/"` | |
| backups.instanceSidecarConfiguration | object | `{}` | The configuration for the Barman Cloud Plugin sidecar that runs in the instance pods. See: https://cloudnative-pg.io/plugin-barman-cloud/docs/next/plugin-barman-cloud.v1/#instancesidecarconfiguration |
| backups.method | string | `"barmanObjectStore"` | One of `barmanObjectStore` (default) or `plugin` |
| backups.pluginConfiguration | object | `{}` | |
| backups.provider | string | `"s3"` | One of `s3`, `azure` or `google` |
| backups.retentionPolicy | string | `"30d"` | Retention policy for backups |
| backups.s3.accessKey | string | `""` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/cluster/templates/_external_clusters.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ externalClusters:
{{ with $pluginConfigurationParameters }}
{{- toYaml . | nindent 8 -}}
{{ end }}
barmanObjectname: {{ include "cluster.fullname" . }}-recovery
barmanObjectName: {{ include "cluster.fullname" . }}-recovery
serverName: {{ .Values.recovery.clusterName }}
{{- end }}
{{- else if eq .Values.mode "replica" }}
Expand Down
10 changes: 10 additions & 0 deletions charts/cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,13 @@ Given a list of objects, returns the first item that matches the key value pairs
{{- define "cluster.barmanPluginEnabled" -}}
{{- eq (include "helpers.hasKeyValue" (list .Values.cluster.plugins (list (list "name" "barman-cloud.cloudnative-pg.io") (list "isWALArchiver" true)))) "true" -}}
{{- end -}}

{{- define "cluster.barmanPluginRequired" -}}
{{- $required := false -}}
{{- if and .Values.backups.enabled (eq .Values.backups.method "plugin") -}}
{{- if eq .Values.backups.pluginConfiguration.name "barman-cloud.cloudnative-pg.io" -}}
{{- $required = true -}}
{{- end -}}
{{- end -}}
{{- $required -}}
{{- end -}}
10 changes: 5 additions & 5 deletions charts/cluster/templates/backup-objectstore.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{{- if and .Values.backups.enabled (eq (include "cluster.barmanPluginEnabled" .) "true") }}
{{- if eq (include "cluster.barmanPluginRequired" .) "true" }}
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: {{ include "cluster.fullname" . }}-backups
namespace: {{ include "cluster.namespace" . }}
{{- with .Values.cluster.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
"helm.sh/hook": pre-install,pre-upgrade,pre-rollback
{{- with .Values.cluster.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "cluster.labels" . | nindent 4 }}
{{- with .Values.cluster.additionalLabels }}
Expand All @@ -28,7 +29,6 @@ spec:
encryption: {{ .Values.backups.data.encryption }}
{{- end }}
jobs: {{ .Values.backups.data.jobs }}

{{- $d := dict "chartFullname" (include "cluster.fullname" .) "scope" .Values.backups "secretPrefix" "backup" }}
{{- include "cluster.barmanObjectStoreConfig" $d | nindent 2 }}
instanceSidecarConfiguration:
Expand Down
22 changes: 11 additions & 11 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,23 +153,23 @@ spec:
{{ include "cluster.externalClusters" . | nindent 2 -}}
{{ include "cluster.backup" . | nindent 2 -}}

{{- $plugins := len .Values.cluster.plugins -}}
{{- if and (gt $plugins 0) (or (gt $plugins 1) (and .Values.backups.enabled (eq (include "cluster.barmanPluginEnabled" .) "true") (eq .Values.backups.method "plugin"))) }}
{{- if or (gt (len .Values.cluster.plugins) 0) (eq (include "cluster.barmanPluginRequired" .) "true") }}
plugins:
{{ $pluginsWithoutBarman := include "helpers.omitKeyValue" (list .Values.cluster.plugins (list (list "name" "barman-cloud.cloudnative-pg.io"))) | fromYamlArray }}
{{- range $pluginsWithoutBarman -}}
- {{ toYaml . | indent 6 | trim }}
{{- end }}
{{- if and .Values.backups.enabled (eq (include "cluster.barmanPluginEnabled" .) "true") (eq .Values.backups.method "plugin") }}
{{- $barmanPlugin := include "helpers.fetchKeyValue" (list .Values.cluster.plugins (list (list "name" "barman-cloud.cloudnative-pg.io"))) | fromYaml -}}
- name: {{ $barmanPlugin.name }}
enabled: true
isWALArchiver: true
{{- if or (eq (include "cluster.barmanPluginEnabled" .) "true") (eq (include "cluster.barmanPluginRequired" .) "true") }}
{{- $barmanPlugin := include "helpers.fetchKeyValue" (list .Values.cluster.plugins (list (list "name" "barman-cloud.cloudnative-pg.io"))) | fromYaml }}
- name: barman-cloud.cloudnative-pg.io
enabled: {{ eq $barmanPlugin.enabled nil | ternary (eq (include "cluster.barmanPluginRequired" .) "true") $barmanPlugin.enabled }}
isWALArchiver: {{ eq $barmanPlugin.isWALArchiver nil | ternary (eq (include "cluster.barmanPluginRequired" .) "true") $barmanPlugin.isWALArchiver }}
parameters:
{{- $parameters := (omit (coalesce $barmanPlugin.parameters dict) "barmanObjectName") -}}
{{ with $parameters }}
{{ toYaml . | indent 8 | trim }}
{{- $parameters := (coalesce $barmanPlugin.parameters dict) -}}
{{- $parametersWithoutObjectName := (omit $parameters "barmanObjectName") }}
{{ with $parametersWithoutObjectName }}
{{- toYaml . | indent 8 | trim }}
{{- end }}
barmanObjectName: {{ include "cluster.fullname" . }}-backups
barmanObjectName: {{ $parameters.barmanObjectName | default (printf "%s-backups" (include "cluster.fullname" .)) }}
{{- end }}
{{- end }}
8 changes: 4 additions & 4 deletions charts/cluster/templates/recovery-objectstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ kind: ObjectStore
metadata:
name: {{ include "cluster.fullname" . }}-recovery
namespace: {{ include "cluster.namespace" . }}
{{- with .Values.cluster.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
"helm.sh/hook": pre-install,pre-upgrade,pre-rollback
{{- with .Values.cluster.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "cluster.labels" . | nindent 4 }}
{{- with .Values.cluster.additionalLabels }}
Expand All @@ -17,7 +18,6 @@ spec:
configuration:
{{- $d := dict "chartFullname" (include "cluster.fullname" .) "scope" .Values.recovery "secretPrefix" "recovery" -}}
{{- include "cluster.barmanObjectStoreConfig" $d | indent 2 }}
retentionPolicy: {{ .Values.recovery.retentionPolicy }}
instanceSidecarConfiguration:
{{- .Values.recovery.instanceSidecarConfiguration | toYaml | nindent 4 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/cluster/templates/recovery-s3-creds.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and (eq .Values.mode "recovery" ) (eq .Values.recovery.method "object_store") (eq .Values.recovery.provider "s3") (not .Values.recovery.s3.inheritFromIAMRole) .Values.recovery.secret.create }}
{{- if and (eq .Values.mode "recovery" ) (eq .Values.recovery.provider "s3") (not (has .Values.recovery.method (list "backup" "import" "pg_basebackup"))) (not .Values.recovery.s3.inheritFromIAMRole) .Values.recovery.secret.create }}
apiVersion: v1
kind: Secret
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
restartPolicy: OnFailure
containers:
- name: minio-cleanup
image: minio/mc
image: minio/mc:latest
command: ['sh', '-c']
args:
- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ cluster:
instances: 2
storage:
size: 256Mi
plugins:
- name: barman-cloud.cloudnative-pg.io
enabled: true
isWALArchiver: true

backups:
enabled: true
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ cluster:
instances: 2
storage:
size: 256Mi
plugins:
- name: barman-cloud.cloudnative-pg.io
enabled: true
isWALArchiver: true

recovery:
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
clusterName: "barman-plugin-backup-restore-cluster"
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
Expand All @@ -29,13 +26,14 @@ recovery:
accessKey: "minio"
secretKey: "minio123"
region: "local"
clusterName: "barman-plugin-backup-restore-cluster"
retentionPolicy: "30d"
scheduledBackups: []
retentionPolicy: "30d"

backups:
enabled: true
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,14 @@ spec:
kind: Cluster
- podLogs:
selector: cnpg.io/cluster=barman-plugin-backup-restore-cluster
- name: Write some data to the cluster
timeouts:
apply: 1s
assert: 30s
try:
- apply:
file: ./02-data_write.yaml
- assert:
file: ./02-data_write-assert.yaml
catch:
- describe:
apiVersion: batch/v1
kind: Job
- podLogs:
selector: batch.kubernetes.io/job-name=data-test
- name: Create a backup
try:
- apply:
file: ./03-backup.yaml
file: ./02-backup.yaml
- apply:
file: ./03-checkpoint.yaml
file: ./02-checkpoint.yaml
- assert:
file: ./03-backup_completed-assert.yaml
file: ./02-backup_completed-assert.yaml
catch:
- describe:
apiVersion: postgresql.cnpg.io/v1
Expand All @@ -67,6 +52,21 @@ spec:
kind: Cluster
- podLogs:
selector: cnpg.io/cluster=barman-plugin-backup-restore-cluster
- name: Write some data to the cluster
timeouts:
apply: 1s
assert: 30s
try:
- apply:
file: ./03-data_write.yaml
- assert:
file: ./03-data_write-assert.yaml
catch:
- describe:
apiVersion: batch/v1
kind: Job
- podLogs:
selector: batch.kubernetes.io/job-name=data-test
- name: Write more data to the database after the backup
try:
- apply:
Expand Down Expand Up @@ -117,4 +117,6 @@ spec:
try:
- script:
content: |
kubectl --namespace $NAMESPACE delete scheduledbackups.postgresql.cnpg.io --all
kubectl --namespace $NAMESPACE delete backups.postgresql.cnpg.io --all
helm uninstall --namespace $NAMESPACE barman-plugin-backup-restore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: barman-plugin-explicit-config-cluster
spec:
plugins:
- name: foo.example.com
enabled: true
isWALArchiver: false
parameters:
foo: bar
- name: barman-cloud.cloudnative-pg.io
enabled: true
isWALArchiver: true
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
type: postgresql
mode: standalone
cluster:
instances: 2
instances: 1
storage:
size: 256Mi
plugins:
- name: barman-cloud.cloudnative-pg.io
enabled: true
isWALArchiver: true
- name: foo.example.com
enabled: true
isWALArchiver: false
parameters:
foo: bar
- name: barman-cloud.cloudnative-pg.io
enabled: true
isWALArchiver: true

backups:
enabled: true
method: barmanObjectStore
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
Expand All @@ -23,9 +30,8 @@ backups:
encryption: ""
s3:
bucket: "mybucket"
path: "/barman-plugin-migration/v1"
path: "/barman-plugin-scheduledbackups/v1"
accessKey: "minio"
secretKey: "minio123"
region: "local"
scheduledBackups: []
retentionPolicy: "30d"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: barman-plugin-config-override-cluster
spec:
plugins:
- name: foo.example.com
enabled: true
isWALArchiver: false
parameters:
foo: bar
- name: barman-cloud.cloudnative-pg.io
enabled: false
isWALArchiver: false
parameters:
foo: bar
barmanObjectName: asd
Loading
Loading