Commit Graph

39 Commits

Author SHA1 Message Date
Armando Ruocco
2c134eafe4
feat: add support for DefaultAzureCredential authentication mechanism (#681)
Some checks failed
Deploy Docusaurus to GitHub Pages / build (push) Failing after 2s
Deploy Docusaurus to GitHub Pages / deploy (push) Has been skipped
release-please / release-please (push) Failing after 1s
This commit adds support for the DefaultAzureCredential authentication
mechanism in Azure Blob Storage. Users can now use the
`useDefaultAzureCredentials` option to enable Azure's default credential
chain, which automatically discovers and uses available credentials in
the following order

1. Environment Variables (Service Principal)
2. Managed Identity
3. Azure CLI
4. Azure PowerShell

This is particularly useful when running on Azure Kubernetes Service
(AKS) with Workload Identity, eliminating the need to explicitly store
credentials in Kubernetes Secrets.

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-08 14:58:27 +01:00
Armando Ruocco
49f1096cba
fix: set LeaderElectionReleaseOnCancel to true to enable RollingUpdates (#615)
Enable the LeaderElectionReleaseOnCancel option in the controller
manager to fix a deadlock issue during RollingUpdate deployments with
leader election enabled.

Without this setting, the old pod holds the leader lease during
shutdown, preventing the new pod from becoming ready. This creates a
deadlock where Kubernetes won't terminate the old pod because the new
pod isn't ready, and the new pod can't become ready because it can't
acquire the lease.

With LeaderElectionReleaseOnCancel enabled, the old pod voluntarily
releases the lease when it receives a shutdown signal, allowing the new
pod to acquire leadership immediately and become ready, enabling smooth
rolling updates.

Closes #419

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
2025-10-24 14:00:24 +02:00
Marco Nenciarini
1be34fe13e
feat(ip): assign copyright to the Linux Foundation (#571)
Adopt the new attribution information for contributions to
CloudNativePG:

```
Copyright © contributors to CloudNativePG, established as
CloudNativePG a Series of LF Projects, LLC.
```

Adopt the SPDX format for Apache License 2.0

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2025-10-07 18:06:06 +02:00
Armando Ruocco
0501e185ba
feat: introduce logLevel setting to control verbosity (#536)
This commit adds a new `logLevel` field to the plugin configuration,
allowing users to select the desired log verbosity for the instances
(e.g. error, warning, info, debug, trace).

Closes #514 

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
2025-09-24 12:32:59 +02:00
Marco Nenciarini
a29aa1c91a
fix(logs): log the correct name when on ObjectStore not found error (#540)
Closes #539

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2025-09-22 10:26:43 +02:00
Armando Ruocco
ec352ac0fd
feat(spec): add support for additional sidecar container arguments (#520)
Introduce the `additionalContainerArgs` field in the `ObjectStore` resource.
It allows specifying an optional list of command-line arguments appended to
the Barman Cloud sidecar container at startup.

Closes #501 

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
2025-09-17 18:35:37 +02:00
Marco Nenciarini
40316b5f2d
fix: remove lifecycle Pod Patch subscription (#378)
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
2025-06-03 10:48:39 +02:00
Marco Nenciarini
918823dbf1
fix: do not add barman-certificates projection if not needed (#354)
Closes #347 #364

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
2025-05-28 18:12:53 +02:00
Leonardo Cecchi
4bb347121d
feat(sidecar): add resource requirements and limits (#307)
Closes #253

Signed-off-by: MichaluxPL <68371308+MichaluxPL@users.noreply.github.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: MichaluxPL <68371308+MichaluxPL@users.noreply.github.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2025-05-09 17:32:02 +02:00
Leonardo Cecchi
8c20e4fe85
fix: duplicate certificate projections (#331)
When referring to the same ObjectStore with custom TLS certificates
multiple times, the plugin was adding the same volume projection two
times. This lead to a wrong Job definition.

This patch makes the plugin add a sidecar to replica cluster Pods that
are using the plugin to get WALs, even if the plugin itself is not used
for WAL archiving.

Closes: #329

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2025-05-09 14:27:20 +02:00
Leonardo Cecchi
f484b9e748
fix: role patching (#325)
Closes: #318

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2025-05-08 11:58:31 +02:00
Marco Nenciarini
e00024f136
feat: support snapshot recovery job (#258)
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2025-04-16 11:45:52 +02:00
Leonardo Cecchi
bac7b673a2
fix: custom CA support for retention policies (#224)
Closes #220

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2025-03-24 18:21:47 +01:00
Jonathan Battiato
5788c1f727
fix: controller and sidecar containers run as non-root (#225)
Closes #177

Signed-off-by: Jonathan Battiato <jonathan.battiato@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2025-03-23 17:00:52 +01:00
Leonardo Cecchi
a7ef56b6e7
feat: implement evaluate lifecycle hook (#222)
This patch allows the plugin trigger a rolling deployment on existing
clusters, enabling seamless migration between the in-tree barman cloud
support and the plugin.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2025-03-21 14:49:55 +01:00
Leonardo Cecchi
fecd1e9513
feat: retention policy (#191)
This commit makes the Barman cloud plugin support the enforcement of
retention policy as provided by the barman-cloud tool suite.

The first recoverability point and the last successful backup are
shown in the status of the ObjectStore resource for each involved
server name.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2025-03-18 17:35:22 +01:00
Leonardo Cecchi
13e3fab268
feat: lenient decoding of CNPG resources (#192)
This patch enables the barman-cloud plugin to function with an operator
that is structurally identical to CNPG but works with a different API group.

It achieves this through lenient decoding of the provided CNPG resources
and injecting the detected GVK into the sidecar, enabling it to correctly
encode and decode the Kubernetes resources.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2025-03-14 12:23:23 +01:00
Leonardo Cecchi
fcbc472092
feat: support custom CA certificates (#198)
This patch enables the use of custom CA certificates when connecting
to the object store in the barman-cloud plugin. The certificates are
injected into the sidecar via a projected volume and used by the
barman-cloud tool suite.

If the barman object name or the key name changes, users must trigger
a Pod rollout to apply the new values.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2025-03-13 12:05:13 +01:00
Marco Nenciarini
dfbeaf802e
fix(deps): use latest commit from CNPG 1.25 branch (#178)
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2025-02-27 15:26:46 +01:00
renovate[bot]
0c8ff7426f
fix(deps): update module github.com/cloudnative-pg/api to v1 (#131)
| datasource | package                       | from                               | to      |
| ---------- | ----------------------------- | ---------------------------------- | ------- |
| go         | github.com/cloudnative-pg/api | v0.0.0-20241209133608-a48d55a7861d | v1.25.0 |


Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-12-24 10:09:58 +01:00
Leonardo Cecchi
9ed845c10f
chore: graceful startup probe (#95)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-12-11 15:57:42 +01:00
Leonardo Cecchi
e4735a2f85
feat: separate recovery object store from replica source (#83)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
2024-12-09 13:29:20 +01:00
Leonardo Cecchi
be4037529c
feat: additional environment variables (#81)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-12-05 13:18:18 +01:00
Leonardo Cecchi
e30edd2318
feat: separate recovery and cluster object store (#76)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-12-05 12:05:14 +01:00
Francesco Canovai
af60a15837
test(e2e): backup and restore (#71)
Run basic backup and restore tests for the plugin. Use MinIO for S3,
Azurite for ACS and fake-gcs-server for GCS.

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-12-02 15:53:34 +01:00
Armando Ruocco
5fd9449b27
feat: add liveness and readiness probe support (#69)
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-12-02 14:51:32 +01:00
Leonardo Cecchi
9d8fa079fe
fix: exit code 0 on clean shutdown (#70)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-11-29 16:15:04 +01:00
Armando Ruocco
afd4603023
fix: ensure restore configuration points to manager wal-restore (#68)
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-11-28 14:04:50 +01:00
Leonardo Cecchi
9c77e3de9f
fix: avoid injecting the plugin environment into the PG container (#62)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-11-22 16:35:01 +01:00
Armando Ruocco
beef96e12f
chore: add secrets cache (#47)
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-11-14 16:10:17 +01:00
Armando Ruocco
240077c771
feat(spike): restore (#29)
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-11-06 16:01:56 +01:00
Francesco Canovai
f877bb19d7
ci: build amd64 and arm64 images for the sidecar and the plugin (#26)
Adds support for building and publishing Docker images for both amd64 and arm64 architectures.
Ensures compatibility across multiple platforms by using cross-compilation.
Updates relevant configuration files for CI/CD to handle the new build process.
Fixes issues related to Python version conflicts and ensures the correct directory structure in the final image.

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
2024-10-24 10:27:26 +02:00
Leonardo Cecchi
76383a30af
feat: grant permissions to read secrets (#25)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-10-03 16:58:56 +02:00
Leonardo Cecchi
2f62d539c9
feat: sidecar role and rolebinding (#23)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-10-02 15:03:07 +02:00
Leonardo Cecchi
ea6ee30d2e
feat: sidecar injection and loading (#22)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-10-02 13:21:04 +02:00
Leonardo Cecchi
dd6548c4a2
feat: operator plugin and manifests (#18)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-10-01 15:40:48 +02:00
Leonardo Cecchi
88e8762858
chore: makes linter happy (#17)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-10-01 11:54:07 +02:00
Francesco Canovai
8c2bf2e6b7
ci: initial pipeline (#3)
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-09-26 17:27:56 +02:00
Armando Ruocco
3f4759c47b
chore: scaffold (#2)
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
2024-09-26 11:52:56 +02:00