Make Grafana a link tile on Homepage, not a live widget (#155) - #178
Merged
Conversation
Homepage's grafana widget makes a mandatory GET /api/admin/stats call, which Grafana gates behind *server admin*. Grafana OSS can't grant server-admin to a service account: isGrafanaAdmin doesn't persist on a SA, an org-Admin SA token still 403s, and the RBAC role-assignment API is Enterprise-only. The only credential that satisfies the widget is a server-admin user -- root-on-Grafana in the Homepage pod for a counts tile, below the least-privilege bar every other widget meets. (The existing basic-auth widget was already dead: the configured grafana-user does not exist in Grafana, so the tile errored regardless.) Drop the widget block + the HOMEPAGE_VAR_GRAFANA_USER/PASSWORD env and their external-secret/secret.example keys; Grafana stays a plain href. Document the OSS limitation and the rejected Viewer-SA/customapi path in both READMEs. Closes #155.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #155.
#155 set out to migrate Homepage's Grafana widget from basic-auth to a
least-privilege service-account token. Investigation showed that's
architecturally impossible on Grafana OSS:
Homepage's
grafanawidget makes a mandatoryGET /api/admin/statscall(if it errors, the whole widget errors). That endpoint is gated by Grafana
server admin — confirmed: it returns 200 only for the server-admin user.
Grafana OSS can't grant server-admin to a service account:
isGrafanaAdmin: trueat SA creation doesn't persist (GET drops it;admin/statsstill 403s)AdminSA token still gets 403fixed:*:reader) is Enterprise-only (all/api/access-control/*404)The only credential that satisfies the widget is a server-admin user —
root-on-Grafana sitting in the Homepage pod for a counts tile, below the
least-privilege bar every other widget meets.
Two side facts:
grafana-userdoesn't exist in Grafana (basic auth 401), so the tile errored regardless./api/search?type=dash-db,/api/datasources,/api/alertmanager/grafana/api/v2/alerts), but only Homepage's one-endpoint-per-tilecustomapiwidget can consume them — which doesn't reproduce the 4-stat layout. Not worth the complexity for low-value counts.So Grafana becomes a plain link tile.
Changes
k8s/homepage/values.yaml— drop the grafana widget block and theHOMEPAGE_VAR_GRAFANA_USER/PASSWORDenv; keep the href tile with a comment explaining why.k8s/homepage/external-secret.yaml— drop thegrafana-user/grafana-passwordkeys.k8s/homepage/secret.example.yaml— drop the grafana stanza, note the link-tile rationale.k8s/homepage/README.md— document the OSS server-admin limitation and the rejected Viewer-SA/customapi path.k8s/kube-prometheus-stack/README.md— replace the old step-7 "create a Viewer login" recipe with the link-tile reality; drop thehomepage-user/homepage-passwordprereq fields.Apply (gandalf, after merge)
Follow-up cleanup (not in this PR)
homepage-widgetGrafana service account.grafana-user/grafana-passwordentries and the BW vaultHomelab Grafanahomepage-user/homepage-passwordfields are now orphaned; prune when convenient.