Skip to content

Sync KubeDB ResourceDashboards with the dashboard charts - #668

Merged
ArnobKumarSaha merged 6 commits into
masterfrom
arnob-dash-sync
Aug 21, 2026
Merged

Sync KubeDB ResourceDashboards with the dashboard charts#668
ArnobKumarSaha merged 6 commits into
masterfrom
arnob-dash-sync

Conversation

@ArnobKumarSaha

Copy link
Copy Markdown
Member

RenderDashboard returned dashboards: [] for a number of KubeDB kinds because the
ResourceDashboard in the hub had spec.dashboards: null. PgBouncer was the reported
case; the same gap existed for Memcached, PerconaXtraDB, RedisSentinel and Weaviate,
and several other kinds were missing individual dashboards the charts ship.

Source of truth for every title and variable in this PR is
kubedb.dev/installer/charts/kubedb-grafana-dashboards, helm-rendered and read from
.spec.model.title / .spec.model.templating.list (92 dashboards).

charts/kubedb-perses-dashboards was checked too: its 89 display names are a strict
subset of the Grafana titles (only Weaviate x3 differ), so it contributes no new names.
See "Perses" below.

Commits

Populate missing KubeDB ResourceDashboards from the dashboard charts
Filled in where dashboards was null — Memcached, PerconaXtraDB, PgBouncer,
RedisSentinel (v1 and v1alpha2) and Weaviate (v1alpha2). Completed Kafka (gains Summary
and Pod), MariaDB (Standard Replication) and Postgres (Remote Replica). Added
kafka.kubedb.com/v1alpha1/connectclusters.yaml for the three Kafka / ConnectCluster
dashboards.

New conditions read the real API fields: spec.topology.mode for MariaDB (enum is
MariaDBReplication|GaleraCluster) and spec.remoteReplica for Postgres.

Add the missing pod ResourceDashboards for KubeDB kinds
hub/resourcetabledefinitions/core.k8s.appscode.com/v1alpha1/kubedb/podviews-*.yaml
references 28 <resource>-pod ResourceDashboards; only 7 existed, so the Dashboard
column in 21 pod views could not resolve. Adds the 17 v1alpha2 dashboards the charts
ship a Pod dashboard for, plus v1 copies for perconaxtradbs and pgbouncers.

Dangling references: 21 -> 4.

Drop ResourceDashboard titles that no dashboard chart ships
Neither chart ships KubeDB / HanaDB / Pod or KubeDB / Milvus / Pod, so those two
entries never resolved. ZooKeeper ships Ensemble, not Database.

Only pass dashboard vars the dashboard actually declares
Every entry passed namespace and app regardless of the dashboard's own templating
list, so those values were inert wherever a dashboard declares something else —
Cassandra Database/Pod use cluster+datacenter, HanaDB Database uses
node_name/node_ip/sid/instance_number/database_name, Memcached Database uses
job, Ignite Database has app but no namespace, Milvus Database has namespace but
no app.

Do not show the MariaDB Galera-Cluster dashboard for standard replication
The condition was replicas != 1, which is also true for spec.topology.mode: MariaDBReplication, so both Galera-Cluster and Standard Replication rendered for a
standard-replication cluster. spec.topology is optional and a MariaDB with
replicas > 1 and no topology is Galera, hence GaleraCluster as the missing-key
default.

Verification

  • go build ./... clean
  • make fmt (including cmd/resource-fmt) idempotent, tree clean afterwards
  • every title: under hub/resourcedashboards/ now resolves to a dashboard the chart
    ships — 0 orphans, was 3
  • both MariaDB conditions and the Postgres one were rendered through
    kubeops.dev/ui-server/pkg/shared.RenderTemplate against unstructured input for
    replicas=1, replicas=3 with no topology, replicas=3 GaleraCluster and
    replicas=3 MariaDBReplication before being committed

go run ./cmd/check-schema/main.go panics with
trigger: error unmarshaling JSON: cannot unmarshal string into map[string]interface {}.
It panics identically on a clean master, so it is pre-existing and unrelated to this
PR, but it means check-schema did not run as a gate here.

Known gaps, not addressed here

  • db2s, documentdbs, hanadbs and milvuses still have unresolvable -pod
    references, because no chart ships a Pod dashboard for them. podviews-hanadbs.yaml
    and podviews-milvuses.yaml should probably drop their dashboard: column — that is
    a resourcetabledefinitions change.
  • KubeDB / Ignite / Pod declares job, cacheName and node but no pod, so
    kubedb.com-v1alpha2-ignites-pod resolves but cannot scope to a pod. The dashboard
    needs a pod variable in the chart before that entry does anything useful.
  • db2s and documentdb keep dashboards: null; neither chart ships anything for them.

Perses

Not touched, and deliberately so. DashboardProvider is
+kubebuilder:validation:Enum=Grafana (apis/ui/v1alpha1/resourcedashboard_types.go:50),
so adding a Perses constant would make the CRD start accepting provider: Perses.
kubeops.dev/ui-server then rejects it at render time
(pkg/graph/dashboard.go:81), turning an up-front validation error into a runtime one.

The blocker is upstream: go.openviz.dev/apimachinery v0.0.10 is the newest published
version and ships no Perses types, so there is no ui.openviz.dev group/render
resource for RenderDashboard to POST to the way it POSTs DashboardGroup today.
openviz.dev/v1alpha1 PersesDashboard (in the perses chart's crds/) is the storage
CRD, not a render API. Worth revisiting once openviz grows the UI side.

Dashboards were missing or incomplete for several KubeDB kinds, so
RenderDashboard returned an empty list for them.

Titles taken from kubedb.dev/installer charts/kubedb-grafana-dashboards
(helm-rendered GrafanaDashboard .spec.model.title).

Filled in (were dashboards: null): Memcached, PerconaXtraDB, PgBouncer,
RedisSentinel (v1 and v1alpha2) and Weaviate (v1alpha2).

Completed: Kafka gains Summary and Pod, MariaDB gains Standard
Replication, Postgres gains Remote Replica.

Added kafka.kubedb.com/v1alpha1/connectclusters.yaml for the three
Kafka / ConnectCluster dashboards.

Conditions use spec.topology.mode for MariaDB (enum is
MariaDBReplication|GaleraCluster) and spec.remoteReplica for Postgres.

Signed-off-by: Arnob kumar saha <arnob@appscode.com>
hub/resourcetabledefinitions/core.k8s.appscode.com/v1alpha1/kubedb/podviews-*.yaml
reference 28 <resource>-pod ResourceDashboards but only 7 existed, so the
Dashboard column in those pod views failed to resolve.

Adds the 17 v1alpha2 dashboards that the charts ship a Pod dashboard for,
plus v1 copies for perconaxtradbs and pgbouncers, which also exist in
kubedb.com/v1.

db2s, documentdbs, hanadbs and milvuses stay unresolved: neither dashboard
chart ships a Pod dashboard for them.

Signed-off-by: Arnob kumar saha <arnob@appscode.com>
Neither kubedb-grafana-dashboards nor kubedb-perses-dashboards ships a
HanaDB / Pod or a Milvus / Pod dashboard, so those two entries never
resolved. ZooKeeper ships Ensemble, not Database.

Signed-off-by: Arnob kumar saha <arnob@appscode.com>
Every entry passed namespace and app regardless of the dashboard's own
templating list, so the values were inert wherever the dashboard declares
something else.

Variables per dashboard come from helm-rendering
charts/kubedb-grafana-dashboards and reading .spec.model.templating.list.

Cassandra Database/Pod use cluster and datacenter, HanaDB Database uses
node_name/node_ip/sid/instance_number/database_name, Memcached Database
uses job, Memcached Pod and Ignite Pod use their own names, Ignite
Database has app but no namespace, Milvus Database has namespace but no
app.

Ignite Pod declares job, cacheName and node but no pod, so
kubedb.com-v1alpha2-ignites-pod cannot scope to a pod. The dashboard
needs a pod variable before that entry can do anything useful.

Signed-off-by: Arnob kumar saha <arnob@appscode.com>
…tion

The condition was replicas != 1, which is also true for a
spec.topology.mode of MariaDBReplication, so both Galera-Cluster and
Standard Replication rendered for a standard-replication cluster.

spec.topology is optional and a MariaDB with replicas > 1 and no topology
is Galera, so the default for the missing key is GaleraCluster.

Rendered through pkg/shared.RenderTemplate against unstructured input for
replicas=1, replicas=3 without topology, replicas=3 GaleraCluster and
replicas=3 MariaDBReplication.

Signed-off-by: Arnob kumar saha <arnob@appscode.com>
podviews-db2s, podviews-documentdbs, podviews-hanadbs and
podviews-milvuses each carry a Dashboard column pointing at a
<resource>-pod ResourceDashboard that cannot exist, because neither
kubedb-grafana-dashboards nor kubedb-perses-dashboards ships a Pod
dashboard for those four kinds.

tableconvertor marks such a column RenderError and puts the lookup
failure in its Message, so the column rendered as a permanent error
rather than failing the table.

With these removed, every dashboard reference in
hub/resourcetabledefinitions resolves to an existing ResourceDashboard.

Signed-off-by: Arnob kumar saha <arnob@appscode.com>
@ArnobKumarSaha
ArnobKumarSaha merged commit 44751b2 into master Aug 21, 2026
7 checks passed
@ArnobKumarSaha
ArnobKumarSaha deleted the arnob-dash-sync branch August 21, 2026 13:26
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.

1 participant