feat: support GrafanaDashboard CR rollout in gateway-addons-helm - #9963
feat: support GrafanaDashboard CR rollout in gateway-addons-helm#9963uladzimirzel wants to merge 2 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Add a dashboard.mode value to the gateway-addons-helm chart to switch between the two ways dashboards are rolled out to Grafana: - configmap (default): dashboards are bundled into the existing grafana-dashboards ConfigMap consumed by the bundled Grafana subchart. - grafana-operator: each dashboards/*.json is rendered as a GrafanaDashboard custom resource (grafana.integreatly.org/v1beta1), which requires the Grafana Operator and a Grafana instance matching dashboard.instanceSelector. The bundled Grafana subchart is not used in this mode (set grafana.enabled=false or clear its dashboardsConfigMaps/dashboardProviders). Also add dashboard.folder and dashboard.instanceSelector values, a failing guard for unsupported modes, a golden template test for the operator mode, and regenerate the helm docs. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Uladzimir Zel <uladzimirzel@gmail.com>
f5dfd93 to
30cacdb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5dfd93c6a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| annotations: | ||
| argocd.argoproj.io/sync-options: ServerSideApply=true |
There was a problem hiding this comment.
Preserve configurable metadata on operator dashboards
When grafana-operator mode is selected, the ConfigMap template is skipped, but this template never applies the documented dashboard.labels or dashboard.annotations values. Consequently, installations using those values for admission policies, ownership, or GitOps behavior silently lose the required metadata on every generated GrafanaDashboard; render these maps here and merge the Argo CD annotation with user annotations.
Useful? React with 👍 / 👎.
| argocd.argoproj.io/sync-options: ServerSideApply=true | ||
| spec: | ||
| allowCrossNamespaceImport: true | ||
| folder: {{ $.Values.dashboard.folder }} |
There was a problem hiding this comment.
Quote the rendered folder value
For valid folder names that YAML interprets as another scalar type, such as "123", "true", or "null", this unquoted substitution renders a number, boolean, or null even when the Helm value was quoted. The GrafanaDashboard CRD expects spec.folder to be a string, so Kubernetes rejects the resource; apply quote to the rendered value.
Useful? React with 👍 / 👎.
| # - "grafana-operator": one GrafanaDashboard custom resource (grafana.integreatly.org/v1beta1) | ||
| # is rendered per dashboard. This requires the Grafana Operator and a Grafana instance | ||
| # matching dashboard.instanceSelector. The bundled Grafana subchart is not used in this mode, | ||
| # so set grafana.enabled=false (or clear grafana.dashboardsConfigMaps and grafana.dashboardProviders). | ||
| mode: configmap |
There was a problem hiding this comment.
Add a new-feature release-note fragment
This introduces a user-facing chart capability but adds no fragment under release-notes/current/new_features/. The repository's release-note compiler consumes only those fragments, so this option will be omitted from the next generated release notes despite the release-note text in the commit message.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Uladzimir Zel <uladzimirzel@gmail.com>
What this PR does / why we need it:
Adds a
dashboard.modevalue to thegateway-addons-helmchart to switch between the two ways Grafana dashboards are rolled out:configmap(default): dashboards are bundled into the existinggrafana-dashboardsConfigMap consumed by the bundled Grafana subchart. Backward compatible — the rendered output for default values is byte-identical to before.grafana-operator: eachdashboards/*.jsonis rendered as aGrafanaDashboardcustom resource (grafana.integreatly.org/v1beta1), which requires the Grafana Operator and a Grafana instance matchingdashboard.instanceSelector. The bundled Grafana subchart is not used in this mode (setgrafana.enabled=falseor clear itsdashboardsConfigMaps/dashboardProviders).Also adds:
dashboard.folderanddashboard.instanceSelectorvalues (defaults:envoy-gateway, labeldashboards: grafana).dashboard.modevalues.grafana-operator.in.yaml) for the operator mode.Which issue(s) this PR fixes:
N/A
Test plan:
helm lintpasses.make helm-template.gateway-addons-helmregenerates goldens;default.out.yaml/e2e.out.yamlare unchanged, proving backward compatibility.gen-check(CI) covers the golden files.Release note:
🤖 Generated with Claude Code