Local Dashboard
What It Is
Section titled “What It Is”A Go + React application that provides a local-first dashboard for Kubernetes cost and utilization. It polls one or more ClusterCost agents and serves both JSON APIs and an embedded SPA.
Main Idea
Section titled “Main Idea”Point the dashboard at one or more ClusterCost agents. It continuously polls, caches, and exposes normalized cost/efficiency data, providing a UI to visualize clusters, namespaces, nodes, and waste hotspots.
How It Works
Section titled “How It Works”- Core:
cmd/dashboard/main.goboots a chi HTTP server, loads config, and starts a ticker to poll agents. - Agents:
internal/agentswraps REST calls to agents, handling JSON decoding and errors. - Store:
internal/storecaches data in-memory, aggregates metrics (cost, efficiency), and derives insights. - API:
internal/apiexposes read-only endpoints and serves static assets. - Frontend: A React + Vite + Tailwind + shadcn app in
web/, compiled and embedded into the Go binary. - Config: Configurable via YAML or environment variables (e.g.,
AGENT_URLS,POLL_INTERVAL).
Run it anywhere
Section titled “Run it anywhere”docker run --rm -p 4173:4173 \ -e CLUSTERCOST_AGENT_URL="grpc://agent.clustercost.svc.cluster.local:9000" \ ghcr.io/clustercost/dashboard:latestAlternative options:
- Kubernetes: deploy as a Deployment/Service inside your cluster for shared access.
- ECS: run as a Fargate service and expose via an internal ALB.
- Binary: download the static build from the releases page when you need zero-container setups.
Connect to agents
Section titled “Connect to agents”Set one or more CLUSTERCOST_AGENT_URL values (comma-separated). The dashboard multiplexes across all configured agents and deduplicates workloads using namespaces, workloads, and tenant labels. Authentication is handled via mTLS when enabled in the agent chart; otherwise the connection remains inside your network boundary.