cloudnative-pg / cloudnative-pg/plugin-barman-cloud

feat: make operator log level configurable via Helm chart and plugin parameters

Offen
#917 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Go
Sterne
191
Forks
72
Ø Merge
2 T. 21 Std.
Gemergte PRs (30 T.)
21

Beschreibung

## Summary

The operator deployment currently has `--log-level=debug` hardcoded in its args (both in [`kubernetes/deployment.yaml`](https://github.com/cloudnative-pg/plugin-barman-cloud/blob/main/kubernetes/deployment.yaml) and the Helm chart template), and there is no way to tune log verbosity either globally or per cluster.

## Current behavior

The operator emits debug-level logs unconditionally. In a production environment with multiple clusters and frequent WAL archiving, this generates a significant volume of log entries (e.g. `generated patch`, lifecycle reconciliation details) that are not actionable and add noise to log aggregation systems (Loki, CloudWatch, etc.).

## Desired behavior

Two complementary levels of control:

**1. Global** — expose the log level as a configurable Helm value:

```yaml
# values.yaml
logLevel: info # default: info (or warn)
```

Wired into the deployment args as `--log-level={{ .Values.logLevel }}`.

**2. Per cluster** — allow overriding verbosity through the `plugins` parameters in the `Cluster` spec, so individual clusters can emit debug logs without affecting the rest:

```yaml
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
barmanObjectName: my-store
logLevel: debug # optional, overrides the global default
```

Additionally, the default in `kubernetes/deployment.yaml` (used for non-Helm installations) should be updated from `debug` to `info`, since running with debug verbosity in production is not a sensible default regardless of the installation method.

## Alternatives considered

- Patching the Deployment directly — reverted on every sync when using GitOps tools like ArgoCD.
- Filtering at the log aggregation layer — works but hides a configuration gap.

## Environment

Helm chart `cnpg/plugin-barman-cloud` v0.6.0, operator image `v0.12.0`, ArgoCD with `selfHeal: true`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit kubernetes/deployment.yaml, values.yaml und der Helm-Chart-Deployment-Vorlage, um nachzuverfolgen, wie die Protokollebene des Operators derzeit festgelegt wird. Folge dann der Verarbeitung der Cluster-Plugin-Parameter für die Überschreibung pro Cluster. Erledigt bedeutet, dass Nicht-Helm-Deployments standardmäßig info verwenden, Helm ein globales logLevel bereitstellt und ein Plugin-Parameter dies für einen einzelnen Cluster überschreiben kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
go, helm, kubernetes
Bereich
devops, infrastructure
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.