Repository navigation
feat: support GrafanaDashboard CR rollout in gateway-addons-helm - #9963
uladzimirzel wants to merge 5 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 👍 / 👎.
|
Can you create an issue with describing why you would need this feature please? |
|
I would like users use this as a subchart instead of adding everything you need into it. |
025af88 to
c71fd02
Compare
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>
c71fd02 to
00dca57
Compare
|
@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. |
|
@zirain Thanks for the feedback! I'm happy to go either direction:
Which would you prefer? The motivating setup is described in #10116. |
|
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! |
There was a problem hiding this comment.
💡 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 }} |
There was a problem hiding this comment.
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 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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>
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
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