Skip to content

Improve CNPG templating#428

Merged
QuentinBisson merged 3 commits intomainfrom
improve-cnpg
Mar 2, 2026
Merged

Improve CNPG templating#428
QuentinBisson merged 3 commits intomainfrom
improve-cnpg

Conversation

@QuentinBisson
Copy link
Contributor

This pull request refactors and improves the CNPG (CloudNativePG) Helm chart templates for Grafana, focusing on how object store credentials are handled for backup and recovery. The main changes include introducing a new helper template to centralize credential logic, splitting backup and recovery object store manifests into separate files, and updating documentation and comments for clarity. These changes make the chart easier to maintain, extend, and configure for different storage backends and provisioning methods.

CNPG template improvements and refactoring:

  • Introduced a new helper template cnpg/_helpers.tpl with the function grafana.cnpg.objectStoreCredentials to centralize and simplify credential configuration for S3 and Azure object stores, supporting both manual and Crossplane-provisioned setups.
  • Split the previous monolithic objectstores.yaml into two separate manifests: objectstore-backup.yaml and objectstore-recovery.yaml, each using the new helper for credentials and improving readability and maintainability. [1] [2] [3]

@QuentinBisson QuentinBisson self-assigned this Mar 2, 2026
@QuentinBisson QuentinBisson requested a review from a team as a code owner March 2, 2026 13:26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic in pseudocode currently looks like this:

if s3 AND s3accessKey:
| configure S3 explicit keys
else if s3:
| configure s3 IRSA
else if azure:
| if crossplane:
| | configure azure crossplane
| else:
| | configure azure manual
else:
| error

Could we have a similar structure for s3 and azure?
Meaning, either we have 2-level tests

if s3
| if explicit-keys

or we keep it all 1-level:

if s3 AND explicit-keys

...but we do the same for all providers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably can yes

Copy link
Contributor

@hervenicol hervenicol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@QuentinBisson QuentinBisson enabled auto-merge (squash) March 2, 2026 15:09
@QuentinBisson QuentinBisson merged commit e6bf5e2 into main Mar 2, 2026
6 checks passed
@QuentinBisson QuentinBisson deleted the improve-cnpg branch March 2, 2026 15:09
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