Skip to content

feat: support GrafanaDashboard CR rollout in gateway-addons-helm - #9963

Open
uladzimirzel wants to merge 5 commits into
envoyproxy:mainfrom
uladzimirzel:feat/addons-helm-grafana-dashboard-operator
Open

uladzimirzel wants to merge 5 commits into
envoyproxy:mainfrom
uladzimirzel:feat/addons-helm-grafana-dashboard-operator

Conversation

@uladzimirzel

Copy link
Copy Markdown

What this PR does / why we need it:

Adds a dashboard.mode value to the gateway-addons-helm chart to switch between the two ways Grafana dashboards are rolled out:

  • configmap (default): dashboards are bundled into the existing grafana-dashboards ConfigMap consumed by the bundled Grafana subchart. Backward compatible — the rendered output for default values is byte-identical to before.
  • 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 adds:

  • dashboard.folder and dashboard.instanceSelector values (defaults: envoy-gateway, label dashboards: grafana).
  • A failing guard for unsupported dashboard.mode values.
  • A golden template test (grafana-operator.in.yaml) for the operator mode.
  • Regenerated Helm docs (README + site API page).

Which issue(s) this PR fixes:
N/A

Test plan:

  • helm lint passes.
  • make helm-template.gateway-addons-helm regenerates goldens; default.out.yaml / e2e.out.yaml are unchanged, proving backward compatibility.
  • gen-check (CI) covers the golden files.

Release note:

gateway-addons-helm: support rolling out Grafana dashboards as GrafanaDashboard custom resources via the new `dashboard.mode=grafana-operator` value (default `configmap` keeps the existing ConfigMap behavior).

🤖 Generated with Claude Code

@uladzimirzel
uladzimirzel requested a review from a team as a code owner September 7, 2026 07:44
@netlify

netlify Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit c39c106
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6ae4982039b10eba68d4e095
😎 Deploy Preview https://deploy-preview-9963--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@uladzimirzel
uladzimirzel force-pushed the feat/addons-helm-grafana-dashboard-operator branch from f5dfd93 to 30cacdb Compare September 7, 2026 07:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +10 to +11
annotations:
argocd.argoproj.io/sync-options: ServerSideApply=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +5 to +9
# - "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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@hsubramanianaks

Copy link
Copy Markdown
Contributor

Can you create an issue with describing why you would need this feature please?

@zirain

zirain commented Sep 8, 2026

Copy link
Copy Markdown
Member

I would like users use this as a subchart instead of adding everything you need into it.
Unless, there's an e2e test to make sure it worked as expected.

@uladzimirzel
uladzimirzel force-pushed the feat/addons-helm-grafana-dashboard-operator branch from 025af88 to c71fd02 Compare September 25, 2026 12:22
uladzimirzel and others added 3 commits September 25, 2026 15:55
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>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Uladzimir Zel <uladzimirzel@gmail.com>
- Apply dashboard.labels and dashboard.annotations to the rendered
  GrafanaDashboard CRs; user annotations win over the built-in
  argocd ServerSideApply default.
- Quote spec.folder to avoid YAML type coercion for numeric/boolean
  folder names.
- Cover labels/annotations in the grafana-operator golden test.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Uladzimir Zel <uladzimirzel@gmail.com>
@uladzimirzel

Copy link
Copy Markdown
Author

@hsubramanianaks Created #10116 describing the motivation: GitOps setups running Grafana via the Grafana Operator can't consume the ConfigMap-based dashboards shipped by the chart, and hand-copying the JSON into hand-written CRs drifts from every release.

@uladzimirzel

Copy link
Copy Markdown
Author

@zirain Thanks for the feedback! I'm happy to go either direction:

  • keep it in gateway-addons-helm and add an e2e test covering the grafana-operator mode (install the operator + a Grafana instance in the kind cluster and assert the dashboards get imported), or
  • extract the dashboard rollout (both configmap and grafana-operator modes) into a dedicated subchart that gateway-addons-helm depends on, so operator-mode users can also consume it standalone.

Which would you prefer? The motivating setup is described in #10116.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added the stale label Oct 25, 2026
@github-actions github-actions Bot added the area/api API-related issues label Oct 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4285d0fe2c

ℹ️ 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".

kind: GrafanaDashboard
metadata:
name: {{ $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Release.Namespace }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Quote the rendered namespace

When the chart is installed into a valid namespace whose name YAML interprets as another scalar, such as true, null, or 123, this renders metadata.namespace as a boolean, null, or number. Kubernetes requires that field to be a string and rejects every generated GrafanaDashboard, so operator mode cannot be installed in those namespaces; pipe .Release.Namespace through quote as the ConfigMap template already does.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T13:20:36.122017Z c39c106 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Signed-off-by: Uladzimir <78650818+uladzimirzel@users.noreply.github.com>
@uladzimirzel

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: c39c1063aa

ℹ️ 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".

@github-actions github-actions Bot removed the stale label Oct 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants